hkill 的初值.
感謝~~~
正解(修了一些變數名稱&加for)
#include<bits/stdc++.h>
using namespace std;
int main(){
string order;
int kill,assist,die,combo,totalKill=0,totalDeath=0,n;
while(cin>>n){
kill=assist=die=combo=0;
for(int i=0;i<n;i++){
cin>>order;
if(order=="Get_Kill"){
combo++;
kill++;
totalKill++;
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 if (kill>0 && combo<3) cout<<"You have slain an enemie."<<endl;
} else if(order=="Get_Assist"){
assist++;
} else if(order=="Die") {
die++;
totalDeath++;
if (die>0 && combo<3) cout<<"You have been slained."<<endl;
else if(combo>=3) cout<<"SHUTDOWN."<<endl;
kill=combo=0;
}
}
cout<<totalKill<<"/"<<totalDeath<<"/"<<assist<<endl;
}
}