if ステートメントをさまざまな方法でレイアウトしてみました。入れ子になった if ステートメントも試しました。同じ結果が得られます。コードを表示する以外に質問する方法がわかりません。
#include <iostream>
#include <conio.h>
#include <string>
using namespace std;
int main()
{
char playerOne, playerTwo;
cout<<"ROCK PAPER SCISSORS!"<<endl;
cout<<"Enter P for Paper"<<endl;
cout<<"Enter R for Rock"<<endl;
cout<<"Enter S for Scissors"<<endl;
cout<<"Player One enter your choice: ";
cin>>playerOne;
cout<<"Player Two enter your choice: ";
cin>>playerTwo;
if ((playerOne = 'R') && (playerTwo = 'R'))
cout<<"Both players played same hand";
else if ((playerOne = 'R') && (playerTwo = 'P'))
cout<<"Player Two wins!";
else if ((playerOne = 'R') && (playerTwo = 'S'))
cout<<"Player One wins!";
else if ((playerOne = 'P') && (playerTwo = 'R'))
cout<<"Player One wins!";
else if ((playerOne = 'P') && (playerTwo = 'P'))
cout<<"Both players played same hand";
else if ((playerOne = 'P') && (playerTwo = 'S'))
cout<<"Player Two wins!";
else if ((playerOne = 'S') && (playerTwo = 'R'))
cout<<"Player Two wins!";
else if ((playerOne = 'S') && (playerTwo = 'P'))
cout<<"Player One wins!";
else if ((playerOne = 'S') && (playerTwo = 'S'))
cout<<"Both players played same hand";
else
cout<<"Invalid inputs!";
getche();
return 0;
}