c++求最大公约数

void gongyueshu(){
int a,b,r,n;

scanf("%d,%d", &a, &b);
if(a<b){
n=a;
a=b;
b=n;
}
r=a%b;
while(r!=0){
a=b;
b=r;
r=a%b;
}
printf("%d",b);
}

#include<stdio.h>
int main() {
void gongyueshu();
gongyueshu();

}

原文地址:https://www.cnblogs.com/fengwenzhee/p/14532012.html