using System;
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("请输入一个数:");
int num1 = int.Parse(Console.ReadLine());
Console.WriteLine("请输入还有一个数:");
int num2 = int.Parse(Console.ReadLine());
int tmp;
if (num1 < num2)
{
tmp = num1; num1 = num2; num2 = tmp;
}
int a = num1; int b = num2;
while (b != 0)
{
tmp = a % b;
a = b;
b = tmp;
}
Console.WriteLine("{0}和{1}的最大公约数为:{2}",num1,num2,a);
Console.WriteLine("{0}和{1}的最小公倍数为:{2}",num1,num2,num1*num2/a);
}
}
}