这是我用殴几里德算法做的,有哪些地方有问题呀,我感觉break那条有点怪怪的
#include<stdio.h>
int main(){
int x,y,gcd,temp1,temp2;
printf("Please enter two numbers.\n");
scanf("%d %d",&x,&y);
if(x<y){
temp1=y;
y=x;
x=temp1;
}
if(x%y==0){
printf("The result is %d \n",y);}
else{
gcd=x%y;
while(gcd%y){
if(gcd%y!=0){
temp2=gcd;
gcd=gcd%y;
y=temp2;}
if(gcd%y==0){
printf("The result is %d \n",y);
break;
}}}
return 0;
}