| ||||||||||
| Online Judge | Problem Set | Authors | Online Contests | User | ||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest | |||||||||
为啥就是不过呢??55555555555555555#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: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator