View Code of Problem 66

#include "stdio.h"
#include "math.h"
#include "string.h"

int  main()
{
	int a,b;
	int x,y;
	int r;
	scanf("%d%d",&a,&b);
	x=a;
	y=b;
	r=a%b;
	for(;r!=0;)
	{
		a=b;
		b=r;
		r=a%b;
	}
	printf("%d/%d\n",x/b,y/b);
}

Double click to view unformatted code.


Back to problem 66