You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

19 lines
317 B

#include <stdio.h>
#include <stdlib.h>
#include "stm32f10x.h" // Device header
int gcd(int a,int b){
return b?gcd(b,a%b):a;
}
int main()
{
int m,n;
printf("请输入两个数:");
scanf("%d",&m);
scanf("%d",&n);
printf("%d 和 %d 的最大公约数为:%d\n",m,n,gcd(m,n));
return 0;
}