编译错误[裂开]
查看原帖
编译错误[裂开]
1121589
tr_712_11楼主2024/4/6 12:06

编译错误,各位dalao帮帮我吧

//万能头文件 
#include<bits/stdc++.h>
//使用std的命名空间 
using namespace std;
//定义常量 

//全局变量 
int x;
string p1;
string p2;
//定义结构体 //struct

//定义函数

//主函数 
int main(){
	//输入
	cin >> x;
	//主程序
	for (int i=0;i<x;i++){
		cin >> p1 >> p2;
		if (p1=='Rock'){
			if (p2=='Rock'){
				cout << "Tie" << endl;
			}
			else if (p2=='Scissors'){
				cout << "Player1" << endl;
			}
			else if (p2=='Paper'){
				cout << "Player2" << endl;
			}
		}
		else if (p1=='Scissors'){
			if (p2=='Rock'){
				cout << "Player2" << endl;
			}
			else if (p2=='Scissors'){
				cout << "Tie" << endl;
			}
			else if (p2=='Paper'){
				cout << "Player1" << endl;
			}
		}
		else if (p1=='Paper'){
			if (p2=='Rock'){
				cout << "Player1" << endl;
			}
			else if (p2=='Scissors'){
				cout << "Player2" << endl;
			}
			else if (p2=='Paper'){
				cout << "Tie" << endl;
			}
		}
	}
	return 0;
}
2024/4/6 12:06
加载中...