循环 最大公约数与最小公倍数 123 简单

题目来源
http://123.206.77.74/JudgeOnline/problem.php?cid=1264&pid=10
输入
两个正整数m和n
输出
m和n的最大公约数和最小公倍数,最小公倍数在int的表示范围内。

样例输入
2 8
样例输出
the greatest common divisor is 2
the least common multiple is 8

编码
#include <stdio.h>
#include <stdlib.h>

int main(int argc, char argv[]) {
int a,b,e,c,d,i,n,m;
scanf ("%d",&n);c=n;
for (i=1;i<=n;i++)
{ for (a=1;a<i;a++)
printf (" “);
for (b=1;b<=n;b++){printf (”
");}
printf ("\n");
}
return 0;
}
PS:本博客属于中国石油大学胜利学院ACM协会所有!
BY:陈卓

猜你喜欢

转载自blog.csdn.net/weixin_43805821/article/details/84728639