#include <iostream>
#include <conio.h>
#include <stdlib.h>
using namespace std;
int main()
{
loop:
int cpu=rand();
cpu%=3;
cpu++;
cout<<"\a\nSang-Kaghaz-Gheichi? (1,2,3)--0 to exit--- ";
int user;
cin>>user;
if(!user) return 0;
cout<<"\nCPU choosed "<<cpu<<".";
if(cpu==user) cout<<"\nYou equalized!";
else
{
switch(user)
{
case 1:
if(cpu==2)
cout<<"\nCPU Won!";
else
cout<<"\nYou Won!";
break;
case 2:
if(cpu==3)
cout<<"\nCPU Won!";
else
cout<<"\nYou Won!";
break;
case 3:
if(cpu==1)
cout<<"\nCPU Won!";
else
cout<<"\nYou Won!";
break;
default:
cout<<"\nWhat was that? Please enter 1-2-3!!";
}
}
getch();
cout<<"\n\n";
goto loop;
}
#include <stdio.h>
int main()
{
int a,b;
char H,C;
printf("please input formol \n");
scanf("%c%d%c%d",&C,&a,&H,&b);
if (b==0)
goto end;
if (a==0)
goto end;
if (b==2*a)
printf("\nhast,alkin");
if (b==(2*a)+2)
printf("\nhast,alkan");
if (b==(2*a)-2)
printf("\nhast,alken");
if (b>2*a+2)
printf("\nnist");
if (b<2*a-2)
printf("\nnist");
end:
printf("\nnist");
return 0;
}