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" main() { int n, i ,j, a[64],sum=0, max=0; scanf("%d",&n); while(n) { sum=0; max=0; for(i=0;i<n;i++) { scanf("%d",&a[i]); if(max<a[i]) max=a[i]; sum+=a[i]; } for(j=max+1;;j++) if(sum%j==0) break; printf("%d\n",j); scanf("%d",&n); } } Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator