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

📄 lind8-1.c

📁 谭浩强第二版的课后习题的答案的源程序
💻 C
字号:
#include<stdio.h>
int a,b,m=1,n;

void input()
{
	printf("Please input two numbers.\n");
	scanf("%d%d",&a,&b);
}

void yue()
{
	int x,y;
	if(a<b)
	{
		n=a;
		a=b;
		b=n;
	}
	x=a;
	y=b;
	for(;m!=0;)
	{
		m=x%y;
		x=y;
		y=m;

	}
	m=x;
}

void bei()
{
	n=a*b/m;
}

void output()
{
	printf("\n%d %d\n",m,n);
}

void main()
{
	input();
	yue();
	bei();
	output();
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -