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 |
高手来帮我看看这段AC了的代码啊,我交了两次,一次0ms,一次15ms,这是怎么回事啊?我交了两次,一模一样的代码,一次0ms,一次15ms,这是怎么回事啊? #include<stdio.h> int main() {int cnt=0,i;long s; scanf("%ld",&s); for(i=1;s>=(i+1)*i/2;i++) if((s-(i-1)*i/2)%i==0)cnt++; printf("%d",cnt); } Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator