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 |
不好意思 那个if 的确没用 当时犯傻了 ^_^In Reply To:"nod" <hr> "后面那个if没用的 " Posted by:Judas at 2006-01-02 19:18:33 这样最准确 #include<stdio.h> int main() { int s,i,sum=0; scanf("%d",&s); for(i=1;;i++) { sum+=i; if(sum-s==0) break; else if((sum-s)%2==0) if((sum-s)/2>=1) break; } printf("%d\n",i); } Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator