最大公约数
#include <stdio.h>int main()
{
int m, n, i;
printf("qingshurulianggeshu:");
scanf("%d%d",&m,&n);
i=m%n;
while (i!=0)
{
m=n;
n=i;
i=m%n;
}
printf("shuchushi%d\n",i);
return 0;
}
不知道哪里错了,输出都是0
#include <stdio.h> int main( void ) { unsigned m, n; scanf( "%d%d", &m, &n ); for( ; n!=0; ) { unsigned t = m; m = n; n = t%n; } printf( "%u\n", m ); }