原始问题:
写一个刺激战场代码
include
using namespace std;
int main()
{
int num_players; // 定义玩家人数变量
cout << "输入玩家人数:";
cin >> num_players; // 读取玩家人数
string players[num_players]; // 定义一个字符串数组来存储所有的玩家名字
for (int i = 0; i < num_players; i++) { // 遍历每一个玩家,读取其名字
cout << "输入第" << (i + 1) << "位的名字:";
cin >> players[i]; }
cout << endl << "刺激战场开始!" << endl;
for (int j = 0; j < num_players - 1; j++) { // 遍历所有的对战配对
for (int k = j + 1 ; k < num_players ; k++) {
cout<< players[j]<<" VS "<< players[k]<<endl; } }
cout<<"游戏结束,感谢大家投入刺激战场!"<<endl; return 0;}
Prev:桐城陈氏辈分表:我知道辈分有:孔雪安邦、金玉岐美。是那的