社区讨论
求助
B2112石头剪子布参与者 2已保存回复 1
讨论操作
快速查看讨论及其快照的属性,并进行相关操作。
- 当前回复
- 1 条
- 当前快照
- 1 份
- 快照标识符
- @lo7ueno3
- 此快照首次捕获于
- 2023/10/27 07:55 2 年前
- 此快照最后确认于
- 2023/10/27 07:55 2 年前
CPP
#include<bits/stdc++.h>
using namespace std;
int main(){
int n;
string Player1 , Player2;
cin >> n;
for(int i = 0;i < n;i++){
cin >> Player1 >> Player2;
if(Player1 == "Rock" and Player2 == "Scissors"){
cout << "Player1"<< endl;
}
//AB
else if(Player1 == "Scissors" and Player2 == "Rock"){
cout << "Player2"<< endl;
}
//BA
else if(Player1 == "Rock" and Player2 == "Paper"){
cout << "Player2"<< endl;
}
//AC
else if(player1 == "Paper" and Player2 == "Rock"){
cout << "Player1"<< endl;
}
//CA
else if (Player1 == "Scissors" and Player2 == "Paper"){
cout << "Player1"<< endl;
}
//BC
else if (Pleyer1 == "Paper" and Player2 == "Scissors"){
cout << "Player2"<< endl;
}
//CB
else if(Pleyer1 == "Rock" and Player2 == "Rock"){
cout << "Tie"<< endl;
}
//AA
else if(Pleyer1 == "Scissors" and Player2 == "Scissors"){
cout << "Tie"<< endl;
}
//BB
else if(Pleyer1 == "Paper" and Player2 == "Paper"){
cout << "Tie" << endl;
}
//CC
}
return 0;
}
回复
共 1 条回复,欢迎继续交流。
正在加载回复...