فایل متنی
فایل cpp
#include "stdafx.h"
#include "iostream"
#include "time.h"
using namespace std;
//alidoran
int main()
{
char x, y ,z;
cout << "player 1 input 1=stone or 2=paper or 3=clipper";
cin >> x;
cout << "player 2 input 1=stone or 2=paper or 3=clipper";
cin >> y;
if (x == '1' && y == '1') z = 0;
if (x == '1' && y == '2') z = 1;
if (x == '1' && y == '3') z = 2;
if (x == '2' && y == '2') z = 0;
if (x == '2' && y == '1') z = 1;
if (x == '2' && y == '3') z = 2;
if (x == '3' && y == '3') z = 0;
if (x == '3' && y == '2') z = 1;
if (x == '3' && y == '1') z = 2;
else cout << "your number is not in range" << endl; system("pause"); return 0;
switch (z) {
case 0:cout << "mosavi"; break;
case 1:cout << "player 1 win"; break;
case 2:cout << "player 2 win"; break;
}
cout << endl;
system("pause");
return 0;
}