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 |
第一次少打了了个空格结果PE~新手!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: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator