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<iostream> using namespace std ; int main() { int n,i,s,t; int a[100]; while (1) { cin>>n; if(n==0) break; s=0; for(i=0;i<n;i++) { cin>>a[i]; s+=a[i]; } t=a[0]; for(i=0;i<n;i++) if(t<a[i]) t=a[i]; for(i=n;i>=1;i--) { if(s%i==0&&s/i>=t) { cout<<s/i<<endl; break; } } } system("PAUSE"); return 0; } Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator