Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

第一次少打了了个空格结果PE~

Posted by sanguo6702 at 2009-02-07 16:11:46 on Problem 1969
新手!42题纪念~

#include<stdio.h>
main()
{
	int m,n,i,k,j;
	while(scanf("%d",&m)!=EOF)
	{
		k=0;n=0;
	for(i=1;i<=10000;i++)
		  {	
		    n=n+i;
	        k++;    
	        if(n>=m)
			{	j=n-m;
		    break;}
		  }
		if(k%2==1)
		printf("TERM %d IS %d/%d\n",m,j+1,k-j);
		else
		printf("TERM %d IS %d/%d\n",m,k-j,j+1);
	}
}

			

Followed by:

Post your reply here:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator