Pages

Tuesday, November 12, 2013

jack n poy code in c++

This will be the output:



and this will be the code:

 # include <iostream>
using namespace std;
int main ()
{
    char one, two;
    cout<<"Enter code Player 1: "; cin>>one; cout<<endl;
    cout<<"Enter code Player 2: "; cin>>two; cout<<endl;
    if (one == 'c' && two == 'p')
    {cout<<"Player 1 wins!"; cout<<endl;}
    else if (one == 'c' && two == 's')
    {cout<<"Player 2 wins!"; cout<<endl;}
    else if (one == 'c' && two == 'c')
    {cout<<"It's a TIE!"; cout<<endl;}
    else if (one == 'p' && two == 'c')
    {cout<<"Player 2 wins!"; cout<<endl;}
    else if (one == 'p' && two == 's')
    {cout<<"Player 1 wins!"; cout<<endl;}
    else if (one == 'p' && two == 'p')
    {cout<<"It's a TIE!"; cout<<endl;}
    else if (one == 's' && two == 'c')
    {cout<<"Player 1 wins!"; cout<<endl;}
    else if (one == 's' && two == 'p')
    {cout<<"Player 2 wins!"; cout<<endl;}
    else if (one == 's' && two == 's')
    {cout<<"It's a TIE!"; cout<<endl;}
    cout<<endl;
    system ("pause");
}

5 comments:

  1. Good day sir, i just want to do bussiness with you pls contact me, i just want you to program my website like this in your program tnx

    ReplyDelete
  2. hallo .,., nagana ba yan sa turbo c

    ReplyDelete
  3. ini sangat membantu saya,terimakasih banyak

    ReplyDelete
  4. apakah ada contact yang bisa dihubungi

    ReplyDelete