#include
Int main ()
{
Int x, y, t, a;
The scanf (" % d % d ", "\ n", & amp; X, & amp; Y);
If (x & lt; Y) {
A=x; X=y; Y=a;
}
T=x % y
While (t!=0) {
X=y; Y=t;
}
Printf (" % d \ n ", y);
}
The results
1 1
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
The Process exited after 4.58 seconds with the return value of 3221225477
Please press any key to continue...
CodePudding user response:
The scanf (" % d % d ", "\ n", & amp; X, & amp; Y);===& gt;> The scanf (" % d % d ", & amp; X, & amp; Y);There can be only one double quotation marks, comma and \ n are removed
CodePudding user response:
Only the first parameter is used to locate the scanf function of only the first two strings a prompt for the second parameter is the function of the input positionCodePudding user response:
Right: the scanf (" % d % d ", & amp; X, & amp; Y);CodePudding user response:
1, the scanf statement is wrong, the first comma on either side of the not, input end without a result, after should be the cause,2, t=x % y; <===remember add a semicolon.
3, the while loop, is infinite loop!
CodePudding user response:
have a semicolon didn't addCodePudding user response: