⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 lind6-1.c

📁 谭浩强第二版的课后习题的答案的源程序
💻 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 + -