View Code of Problem 66

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

Double click to view unformatted code.


Back to problem 66