#include <bits/stdc++.h>
using namespace std;
int arr[1000][10];
struct emp{
int num;
int count;
};
emp aaa[1000];
bool reduce(emp a,emp b){
if(a.count!=b.count){
return a.count > b.count;
}
else{
return a.num < b.num;
}
}
int main()
{
int test;
cin >> test;
for(int k=1; k <= test; k++){
int n;
cin >> n;
for(int i=0; i < n; i++){
aaa[i].num=i;
aaa[i].count=0;
for(int j=0; j < 7; j++){
int m;
cin >> m;
aaa[i].count+=m;
}
}
sort(aaa,aaa+n,reduce);
cout << "test case " << k << ":" << endl;
for(int i=0; i < n; i++){
cout << "Employee " << aaa[i].num << ": " << aaa[i].count << endl;
}
}
}
Sicily 9994. 3. Computing the weekly hours for each employee
最新推荐文章于 2017-02-20 19:57:30 发布