6 like 0 dislike
289 views
給定兩個數字,請得出它們的最大公因數
[Normal] Essay (Open question) - asked in 程式設計(一) by (5.2k points)
ID: 29675 - Available when: Unlimited - Due to: Unlimited
| 289 views

1 Answer

0 like 0 dislike
Hidden content!
#include ** *** ******* *

#include ****** * *



int GCD(int x,int y);



 int main()

{
** *** ** *** ** ** * * * n1 , n2;


* * * ** * * * * *** * * ** *** ****** %d", &n1 , &n2);
** **** * * ** ** * * *** * *** ** * ****** ** ***** * , n2));


** *** * * * *** ** **** 0;

}



int GCD(int x,int y)



{

if(x==0)
* * ** ** *** * * * *** * ** *
* * * * ** * * * * * * ** * *** * ******** **** * y;
* *** * * ** * ** * * *


** ** **** ** ****
*** *** ** * ** *** ****** * ** *** * *** * *******
* ** * ** * * * *** * ******* ** ** ** * ** * ** ** * **** * * * (y%x,x);
* *** * ** ******* ** * * ****** *** *** ***

}
answered by (1.3k points)
Welcome to Peer-Interaction Programming Learning System (PIPLS) LTLab, National DongHwa University
English 中文 Tiếng Việt
IP:172.69.58.177
©2016-2024

Related questions

5 like 0 dislike
0 answers
[Normal] Essay (Open question) - asked Oct 29, 2017 in 程式設計(一) by semicolon (5.2k points)
ID: 29674 - Available when: Unlimited - Due to: Unlimited
| 258 views
3 like 0 dislike
0 answers
[Normal] Essay (Open question) - asked Feb 19, 2017 in Introduction to Computer Programming I (C) by The Contributor (20.9k points)
ID: 21951 - Available when: Unlimited - Due to: Unlimited
| 190 views
12,783 questions
183,443 answers
172,219 comments
4,824 users