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

跪求 请帮忙测试一下,应该是每位体可就是不过?!!!!

Posted by raidou at 2004-12-27 19:49:44 on Problem 1969
#include <stdio.h>
#include <math.h>
void main(){
	int n,j,i;
	scanf("%d",&n);
	while(n>=1&&n<=10000){
        i=1;
	    j=n-i;
	    while(j>i){
		    i++;
		    j=j-i;
		}
		printf("%d %d",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