|
|
вернуться в форумWrong Answer, test 1! Послано Roma 11 апр 2014 21:20 My C++ solution: #include <iostream> using namespace std; struct team { int id; int n; }; int main() { register int temp, temp_2; team *com; team temp_team; int i; cin >> i; com = new team[i]; for ( temp = 0; temp < i; temp++ ) { cin >> com[temp].id >> com[temp].n; } for ( temp = 0; temp < i; temp++ ) for ( temp_2 = 0; temp_2 < i; temp_2++ ) { if ( com[temp].n > com[temp_2].n ) { temp_com = com[temp]; com[temp] = com[temp_2]; com[temp_2] = temp_com; } } for ( temp = 0; temp < i; temp++ ) { cout << com[temp].id << " " << com[temp].n << endl; } return 0; } |
|
|