#21919: WA Line 15


slime.creeper3@gmail.com (Slimlix)

學校 : 不指定學校
編號 : 108310
來源 : [114.27.68.205]
最後登入時間 :
2021-09-07 22:44:18
a130. 12015 - Google is Feeling Lucky -- UVa12015 | From: [1.200.202.172] | 發表日期 : 2020-07-30 18:20

#include <iostream>

using namespace std;

 

struct website {

char url[100];

int relation;

};

 

int main()

{

int i;

while (cin >> i)

{

website input[10];

int highest = 0;

for (int k = 0 ; k < i; k++)

{

for (int r = 0 ; r < 10 ; r++)

{

getline(cin, input[r].url); 

cin >> input[r].relation;

}

for (int r = 0 ; r < 10 ; r++)

if (input[r].relation > highest) highest = input[r].relation;

cout << "Case #" << k+1 << ":" << endl;

for (int r = 0 ; r < 10  ; r++)

if (input[r].relation == highest) cout << input[r].url << endl;

}

}

}

 
ZeroJudge Forum