#12283: C++ 簡易參考解答


shawn2000100 (東華財金)

學校 : 國立東華大學
編號 : 57300
來源 : [27.53.168.5]
最後登入時間 :
2021-09-19 19:53:19
b762. 英國聯蒙 | From: [124.9.162.51] | 發表日期 : 2017-06-25 17:37

#include <iostream>
#include <string>
using namespace std;

int main() {
int n, kill, assist, die, combo;
string order;

while ( cin >> n ) {
kill = assist = die = combo = 0;

for ( int i = 0; i < n; i++ ) {
cin >> order;

if ( order == "Get_Kill" ) {
combo++;
kill++;
if ( combo == 3 )
cout << "KILLING SPREE!" << endl;
else if ( combo == 4 )
cout << "RAMPAGE~" << endl;
else if ( combo == 5 )
cout << "UNSTOPPABLE!" << endl;
else if ( combo == 6 )
cout << "DOMINATING!" << endl;
else if ( combo == 7 )
cout << "GUALIKE!" << endl;
else if ( combo >= 8 )
cout << "LEGENDARY!" << endl;
else
cout << "You have slain an enemie." << endl;
} else if ( order == "Get_Assist" ) {
assist++;
} else if ( order == "Die" ) {
cout << ( ( combo < 3 ) ? "You have been slained." : "SHUTDOWN." ) << endl;
combo = 0;
die++;
}
}
cout << kill << "/" << die << "/" << assist << endl;
}
}

 
ZeroJudge Forum