Follows 264.c (Total 21 lines):

/* @JUDGE_ID:4461XX 264 C */
/* A */
#include <stdio.h>
long number,n,top;
void main(void)
{
	while(scanf("%ld",&n)==1)
	{
		printf("TERM %ld IS ",n);
		top=1;number=n;
		while(number>0)
		{
			number=number-top;
			top++;
		}
		top--;
		n=n-top*(top-1)/2;
		if(top%2==0)printf("%ld/%ld\n",n,top-n+1);
		else printf("%ld/%ld\n",top-n+1,n);
	}
}

Back to statistics
Ya-Lin Huang (C)
huangyl@gmail.com