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

为啥就是不过呢??55555555555555555

Posted by raidou at 2004-12-27 19:27:43 on Problem 1969
#include <stdio.h>
#include <math.h>
void main(){
	int n,j,i;
	scanf("%d",&n);
	while(n>=1&&n<=10000000){
        i=1;
	    j=n-i;
	    while(j>i){
		    i++;
		    j=j-i;
		}
	    if(i%2==1){
			if(j!=0){
				printf("TERM %d IS %d/%d\n",n,j,i+2-j);}
			else{
                printf("TERM %d IS 1/%d\n",n,i);}
		}
	    else{
		    if(i%2==0){
                if(j!=0){
			        printf("TERM %d IS %d/%d\n",n,i+2-j,j);}
		        else{
                    printf("TERM %d IS %d/1\n",n,i);}
				
			}
		}
		scanf("%d",&n);
	}
}

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