#include <stdio.h> int main(){ int a,b,c=1,d=1,i=1; if (scanf("%d %d",&a,&b)!=0){ while (d==1){ if (a%i==0 && b%i==0){c = i;} if (i%a==0 && i%b==0){d = i;} i++; } printf("%d %d",c,d); }else{ printf("something wrong"); } return 0; }
c语言编程练习题:7-26 最大公约数和最小公倍数
作者:yunjinqi
类别:编程
日期:2023-05-29 13:30:58
阅读:573 次
消耗积分:0 分
版权所有,转载本站文章请注明出处:云子量化, https://www.yunjinqi.top/article/151
最新文章
系统当前共有 404 篇文章