9 like 0 dislike
在座標平面上給予一個矩形的對角座標就可以定義一個矩形。給你兩個矩形,請寫一個程式判斷這兩個矩形是否有重疊。

重疊的定義:兩者相交之面積大於0。(也就是如果只有點相交並不算重疊)

輸入說明:

會連續輸入八個浮點數,前四個代表第一個矩形的對角座標,後四個代表第二個矩形的對角座標。四個浮點數之間會用空格隔開。

 

輸出說明:

如果兩個矩形有重疊,請在銀幕上輸出”yes”,反之則輸出”no”。

 

輸入範例:

0.0 0.0 2.2 2.2 1.1 1.1 5.5 5.5

 

輸出範例:

yes
[Exam] asked in 2017-1 程式設計(一)AD by (20.9k points)
Available when: Unlimited - Due to: 2017-10-27 21:30
| 13 views

6 Answers

0 like 0 dislike
Hidden content!
** * * * * ** ****** * * * * ** ** ** ** ** * *
20/100 answered by (202 points)
0 like 0 dislike
Hidden content!
** *** * ** * *** * ** ** * ****
5/100 answered by (196 points)
0 like 0 dislike
Hidden content!
*** **** * *** *** * ***** * * ** ** ** **********
40/100 answered by (228 points)
0 like 0 dislike
Hidden content!
* * * * * * * ** * * **** * * * ****** ****
100/100 answered by (154 points)
0 like 0 dislike
Hidden content!
* * * * * * * ****** ** * * * * **
40/100 answered by (209 points)
0 like 0 dislike
Hidden content!
**** * ** ** ****** ***** **** * ** ** **
100/100 answered by (215 points)
Get it on Google Play Welcome to Peer-Interaction Programming Learning System (PIPLS) LTLab, National DongHwa University
English 中文 Tiếng Việt
IP:108.162.221.219
©2016-2019

Related questions

3 like 0 dislike
12 answers
[Exam] asked Dec 23, 2017 in 2017-1 程式設計(一)AD by 楊修俊 (20.9k points)
Available when: 2017-12-23 09:00 - Due to: 2017-12-23 12:10
| 56 views
2 like 0 dislike
0 answers
[Resource] asked Nov 9, 2017 in 2017-1 程式設計(一)AD by 楊修俊 (20.9k points)
Available when: Unlimited - Due to: Unlimited
| 17 views
2 like 0 dislike
0 answers
[Resource] asked Nov 9, 2017 in 2017-1 程式設計(一)AD by 楊修俊 (20.9k points)
Available when: Unlimited - Due to: Unlimited
| 14 views
2 like 0 dislike
0 answers
[Resource] asked Nov 9, 2017 in 2017-1 程式設計(一)AD by 楊修俊 (20.9k points)
Available when: Unlimited - Due to: Unlimited
| 17 views
8,045 questions
60,931 answers
33,050 comments
1,170 users