| ||||||||||
| 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:1744为什么Presentation Error啊???????这是我的程序.In Reply To:1744为什么Presentation Error啊???????这是我的程序. Posted by:Zhouye at 2005-02-08 17:33:29 > #include <iostream>
>
> using namespace std;
> int n,total=0,temp=0,num=1;
> int stick[1000];
>
> int main()
> {
> cin >> n;
> while(n!=0)
> {
> for(int i=0;i<n;i++)
> {
> cin >> stick[i];
> total=total+stick[i];
> }
> total=total/n;
> for(int i=0;i<n;i++)
> {
> temp+=((stick[i]>total)?(stick[i]-total):(total-stick[i]));
> }
> temp=temp/2;
> cout << "Set #" << num << endl
> << "The minimum number of moves is " << temp
> << "." << endl;
> temp=0;
> num++;
> total=0;
> cin >> n;
> }
> }
>
>
>
>
你这究竟是那道题目????????
Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator