回分類題庫
d232: 101OOP Lab Exercise: Map for Summoner query system
出處:

Difficulity : N/A
Accepted : 29 Times | Submit :81 Times | Clicks : 1099
Accepted : 27 Users | Submit : 27 Users | Accepted rate : 100%
Time Limit :10000 ms | Memory Limit : 64000 KBytes
題目加入時間 : 2012-12-24 15:50

Content :

There are several Summoners in Summons Canyon. 

Implement the Summoner query system to search for the Summoner conveniently.

You can use struct or class to save data.

Such as

struct Data
{
    int s_ELO;
    int s_SingleRankWins;
    int s_SingleRankLosses;

    int s_TeamELO;
    int s_TeamRankWins;
    int s_TeamRankLosses;

    string s_1ndMostFrequentChampion;
    string s_2ndMostFrequentChampion;
    string s_3ndMostFrequentChampion;

    float s_1ndWinRate;
    float s_2ndWinRate;
    float s_3ndWinRate;
};

Input :

The first line is the total of the Summoners.

And then input the data as follows.

Summoner's ID.

Single Rank's ELO,Wins,Losses.

Team Rank's ELO,Wins,Losses.

The most frequently used champion

1. [champion's name] [win rate]

2. [champion's name] [win rate]

3. [champion's name] [win rate] 

If champion's name is "None", you don't need to input win rate of this champion.

And the win rate is float number that should only round off to the 2nd decimal place.

 

After input the data of Summoners, you can input two kinds of command for search and quit.

1.S [ID]:print the data of this Summoner.

2.Q:Quit this data and you can input the new data.

Output :

If your command is S [ID], you should print the following:

Summoner:[ID]

===============Single Rank===============

ELO:[Single rank's ELO]

Wins:[Single rank's wins]

Losses:[Single rank's losses]

================Team Rank================

ELO:[Team rank's ELO]

Wins:[Team rank's wins]

Losses:[Team rank's losses]

====The most frequently used champion====

1. [champion'name] [win rate]

2. [champion'name] [win rate] (if champion's name is "None", you don't need to print)

3. [champion'name] [win rate] (if champion's name is "None", you don't need to print)

If there is no used champion, only print "None."

 

[Prompt of win rate]

#include<iomanip>

cout  << fixed  <<  setprecision(2) << 3.1234  <<  endl;

The ouput is 3.12.

 

If you can't find the Summoner, you should print "Summoner does not exist.".

 

Sample Input :

3
orange
1509 8 5
1210 26 28
Sona 83.3333
Nunu 33.3333
Warwick 0.0000
Iris
0 0 0
0 0 0
None
None
None
JPower
1518 61 51
1244 15 15
Fizz 96.6666
None
None
S TsaiYenLi
S JPower
S orange
S Iris
Q

Sample Output :

Summoner does not exist.
Summoner:JPower
===============Single Rank===============
ELO:1518
Wins:61
Losses:51
================Team Rank================
ELO:1244
Wins:15
Losses:15
====The most frequently used champion====
1.Fizz:96.67%
Summoner:orange
===============Single Rank===============
ELO:1509
Wins:8
Losses:5
================Team Rank================
ELO:1210
Wins:26
Losses:28
====The most frequently used champion====
1.Sona:83.33%
2.Nunu:33.33%
3.Warwick:0.00%
Summoner:Iris
===============Single Rank===============
ELO:0
Wins:0
Losses:0
================Team Rank================
ELO:0
Wins:0
Losses:0
====The most frequently used champion====
None.

Hint :


  

Author :

(管理員:oop10105)

  Solve it!   Status Forum (0)

C++
C
JAVA
43987. oop100703031 (4 ms , 530KB)
43178. oop100703019 (4 ms , 546KB)
43224. oop100703020 (6 ms , 512KB)
43220. oop100703046 (6 ms , 532KB)
43213. oop100703050 (6 ms , 540KB)
沒有解題記錄 58372. nwgs524513cja (98 ms , 876KB)
58370. nwgs524513cja (98 ms , 884KB)
58371. nwgs524513cja (130 ms , 930KB)

執行時間會受很多因素影響因此僅供參考,主機等級請看這裡