求助c程,呼唤大神。
浏览量:5626 回帖数:25
13楼
#include <stdio.h>
int main(void)
{
int ***, lcm, m, n;
int repeat, ri; scanf("%d", &repeat);
for(ri = 1; ri <= repeat; ri++){
scanf("%d", &m);
scanf("%d", &n);
for(lcm=1;lcm++){
if(lcm%m==0&&lcm%n==0) /* 最小公倍数lcm */
break;
}
***=m*n/lcm;
printf("%d is the least common multiple of %d and %d, %d is the greatest common divisor of %d and %d.\n", lcm, m, n, ***, m, n);
}
}
return 0;
}
#include <stdio.h>
int main(void)
{
int ***, lcm, m, n;
int repeat, ri; scanf("%d", &repeat);
for(ri = 1; ri <= repeat; ri++){
scanf("%d", &m);
scanf("%d", &n);
for(lcm=1;lcm++){
if(lcm%m==0&&lcm%n==0) /* 最小公倍数lcm */
break;
}
***=m*n/lcm;
printf("%d is the least common multiple of %d and %d, %d is the greatest common divisor of %d and %d.\n", lcm, m, n, ***, m, n);
}
}
return 0;
}
签名档
[light]牵着你的手到老,你是我永远的依靠![/light] [light]真的爱你!骏![/light] █ ☆真 ◢██◣ █ █* ◢██◣☆ █ ≈ █* █ █* 爱█ █▅▅█ █ * █的 █ ◥◣◢◤ █ 你▂ ███◣◥██◤☆ ◥◤ * ◥██◤*
发表于 2012/4/18 9:05:18

