#2614: 請幫忙看一下


ztex100028092 (巴拉呆)


我打ㄉ結果說是TEL能幫忙一下ㄇ?? 謝謝 

 

#include<stdio.h>
#include<stdlib.h>


int main()
{
        int a,b,temp=0;   
        scanf("%d;%d",&a,&b);
        while(a%b!=0);
        {temp=a;
        a=b;
        b=temp%b;
                      }
        printf("%d",b);
       system("pause");
return 0;

}

#2615: Re:請幫忙看一下


leopan0922 (zz)


我打ㄉ結果說是TEL能幫忙一下ㄇ?? 謝謝 

 

#include
#include


int main()
{
        int a,b,temp=0;   
        scanf("%d;%d",&a,&b);
        while(a%b!=0);
        {temp=a;
        a=b;
        b=temp%b;
                      }
        printf("%d",b);
       system("pause");
return 0;

}

改好了看看了解一下吧

#include<stdio.h>
#include<stdlib.h>
int main()
{
    int a,b,temp=0;   
    while(scanf("%d%d",&a,&b)==2)
    {
        while(a%b!=0)
        {
            temp=a;
            a=b;
            b=temp%b;
        }
        printf("%d\n",b);
    }    
}