求两个数的最小公倍数这题,为什么答案是错的
程序代码:
# include <stdio.h> int main() { int A, B, t1, t2, t, min, temp; scanf("%d %d", &A, &B); temp = A*B; while (1) { if (A > B) { t = A; A = B; B = t; } t1 = B - A; t2 = A; A = t1; B = t2; if (A==0) break; } min = temp / t2; printf("%d\n", min); return 0; }[local]1[/local][local]2[/local]