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 |
Re:为什莫我的错误阿In Reply To:为什莫我的错误阿 Posted by:ch_619999 at 2007-09-24 12:26:47 > #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