判断两个数的最大公约数
//这个是真忘了,求解答。#include <stdio.h>
main()
{int a,b,c;
scanf("%d%d",&a,&b);
while(【请填空】)
{【请填空】;a=b;【请填空】}
printf("最大公约数为%d",【请填空】);
}
#include <stdio.h> int main( void ) { unsigned a, b; scanf( "%u%u", &a, &b ); while( b != 0 ) { unsigned t = a; a = b; b = t%b; } printf( "最大公约数为 %u\n", a ); }
[此贴子已经被作者于2022-2-11 21:13编辑过]