| ||||||||||
| 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:Re:改后的代码... Posted by:mayp at 2007-03-16 14:14:12 > #include<iostream>
> #include<cstring>
> using namespace std;
> int main()
> {
> int n;
> cin >> n;
> int p=0,pe= 0;
> int i,s,tp;
> char name[100],temp[100];
> int sub[4],time[4];
> while(n--){
> cin >> temp;
> tp = 0;s = 0;
> for(i = 0;i< 4;i ++)
> {
> cin >> sub[i] >> time[i];
> if(time[i]){s += 1;tp += (time[i] + 20 * (sub[i]-1));}
> }
> if(s < p)
> continue;
> else
> {
> if(s > p)
> {
> p = s;
> pe = tp;
> strcpy(name,temp);
> }
> else
> if(pe > tp)
> {
> p = s;
> pe = tp;
> strcpy(name,temp);
> }
> }
> }
> cout << name <<' '<<p <<' ' <<pe << endl;
> return 0;
> }
Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator