Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

Re:为什莫我的错误阿

Posted by suyong126 at 2007-10-03 16:05:07 on Problem 1011
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:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator