我编写了一个示例程序来计算两个数字的 gcd。这里是:
#include stdio.h
int main(void) {
int m, n, rem;
printf("Enter two numbers consecutively(with a space between them): ");
scanf("%d %d", &m, &n);
while (m) {
n = m % n; //problem here
n = rem;
}
printf("%d is the GCD", rem);
return 0;
}
我认为我应该将模运算符语句的输出存储在 rem 中,但到目前为止我的程序没有响应任何给定的输入。有人可以给我一个线索。