📄 lind6-1.c
字号:
#include<stdio.h>
void main()
{
long a,b,t,i,app,mul; //app presents the max common approximate number of the two numbers
// mul presents the min common multiple number of the two numbers
lin: printf("\nPlease input two numbers.\n");
scanf("%ld%ld",&a,&b);
if(a<b)
{
t=a;
a=b;
b=t;
}
for(i=b;i>0;i--)
{
(a%i==0)&&(b%i==0)? (app=i,i=0):(1);
}
mul=a*b/app;
printf("Their max common approximate number is %ld.\n",app);
printf("Their min common multiple number is %ld.\n",mul);
goto lin; //The max pass number is 46340
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -