View Code of Problem 66

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

Double click to view unformatted code.


Back to problem 66