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 |
跟2853一样的,建议做了这道火速做2853,复制改改输入就OK了#include <cstdio> int main() { int number; while(scanf("%d",&number)!=EOF) { int ans=0,sum=0; for(int i=1;(i+2)*(i+1)<=2*number;++i) { sum+=i; if((number-sum)%(i+1)==0)++ans; } printf("%d\n",ans+1); } return 0; } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator