#include <stdio.h>
int main(){
int gcd(int,int);
int lcm(int,int);
int num1,num2;
printf("Please input two number ,we will calculate the gcd and the lcm of them.\n");
scanf("%d %d",&num1,&num2);
printf("The gcd of them is %d, the lcm of them is %d.\n",gcd(num1,num2),lcm(num1,num2));
}
//计算最大公约数
int gcd(int num1,int num2){
return num2==0? num1: gcd(num2, num1 % num2);
}
//最小公倍数的计算
int lcm(int num1,int num2){
return num1*num2/gcd(num1,num2);
}