3 like 0 dislike
寫一個程式讀入三個平面上的點座標, 然後印出其中距離原點最遠的點. 如果兩個或多個點有相同的距離, 輸出最先出現的點座標.

Sample Input:

3 4 5 0 0 5

Sample Output:

3

4

 

參考書籍:由片語學習C程式設計
[Normal] Coding (C) - asked in Introduction to Computer Programming I (C) by (20.9k points)
Available when: Unlimited - Due to: Unlimited
| 37 views

1 Answer

0 like 0 dislike
Hidden content!
#include <stdio.h>
#include <stdlib.h>

int main()
{
* * ***** * * * * * ** a1,b1,c1,a2,b2,c2,max1,max2,max3=0;
* ***** * ** ****** ** * a3,b3,c3;
** **** *** *** * * * *** * ** * * * * **
* * * *** *** * * * * * ** * * *** ******* ***** ****
*** ** * *** * * **** * * * ****** * ** ** **
*** ** * ** * ** ** *** *** **
** ** ** *** ** ** **** *** * ** **
* *** * ** ** * * * * * **** * **
* ****** * * * *** *** ***
    {
* * * * **** ** *** * * * ***** * * *** ** * ******
*** ** * ** * ** **** *** *** * *** * * ***
** * * * * ** * * ** * *** * ** * ** * *** **
    }
**** ** * ** ** * * * * *
    {
* * * *** * ** *** * * * * ** * * * * *** *
*** * * ** *** ** ** * * ** ** * * * *** * * * ** **
* * * * * *** * * * *** ** ***** *** * * *
    }
*** * **** * * * * * * * **** **
** * * *** ***** * ** *
* * * * * * ** ** * **** * * ** *** * * * ** *** *****
* ** * ** ** *** * ** * ** * ******** **** *
* * ** ** * * *** * * * ** * * * *** **** * **
    }
** * * ** ** * * ** * ***** *** ** %d",max1,max2);
* * * * ** * * 0;
}
answered by (466 points)
0 0
Case 0: Wrong output
Case 1: Wrong output
Case 2: Wrong output
0 0
Case 0: Correct output
Case 1: Correct output
Case 2: Correct output
Get it on Google Play Welcome to Peer-Interaction Programming Learning System (PIPLS) LTLab, National DongHwa University
English 中文 Tiếng Việt
IP:172.69.63.105
©2016-2020

Related questions

3 like 0 dislike
0 answers
[Normal] Coding (C) - asked Feb 5, 2017 in Introduction to Computer Programming I (C) by The Contributor (20.9k points)
Available when: Unlimited - Due to: Unlimited
| 26 views
3 like 0 dislike
0 answers
[Normal] Coding (C) - asked Feb 5, 2017 in Introduction to Computer Programming I (C) by The Contributor (20.9k points)
Available when: Unlimited - Due to: Unlimited
| 24 views
3 like 0 dislike
0 answers
[Normal] Coding (C) - asked Feb 5, 2017 in Introduction to Computer Programming I (C) by The Contributor (20.9k points)
Available when: Unlimited - Due to: Unlimited
| 26 views
3 like 0 dislike
0 answers
[Normal] Coding (C) - asked Feb 5, 2017 in Introduction to Computer Programming I (C) by The Contributor (20.9k points)
Available when: Unlimited - Due to: Unlimited
| 23 views
3 like 0 dislike
0 answers
[Normal] Coding (C) - asked Feb 5, 2017 in Introduction to Computer Programming I (C) by The Contributor (20.9k points)
Available when: Unlimited - Due to: Unlimited
| 24 views
10,365 questions
112,518 answers
98,381 comments
3,407 users