View Code of Problem 66

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

Double click to view unformatted code.


Back to problem 66