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 |
帮我看看错哪儿了吧,谢谢了!这题好像很简单,花不了您多少时间的!#include<stdio.h> void main(){ long m,sum=0,i,t; scanf("%d",&m); for(i=1;;i++){ sum+=i; if(sum>=m) break; } if(sum==m) t=i; else{ if((sum-m)%2) t=i+2; else t=i; } printf("%d\n",t); } Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator