paperrockstone3

paperrockstone3 - #include <iostream> using namespace...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: #include <iostream> using namespace std; void main() { int a, b, player1, player2; player1 = 0; player2 = 0; cout << " PLEASE ENTER THE CHOICES RESPECTIVELY. PLEASE ENTER 1 FOR SCISSOR, 2 FOR PAPER and 3 FROM ROCK." << endl ; cin >> a ; cin >> b ; if ( a==b ) { cout <<" You have entered a draw match. " << endl; } else if ( a==1 && b==2 ) { player1 = player1 + 1; cout <<" player 1 beats player 2. " << endl; } else if ( a==2 && b==1) { player2 = player2 + 1; cout <<" player 2 beats player 1. " << endl; } else if ( a==1 && b==3 ) { player2 = player2 + 1; cout <<" player 2 beats player 1. " << endl; } else if ( a==3 && b==1 ) { player1 = player1 + 1; cout <<" player 1 beats player 2. " << endl; } else if ( a==2 && b==3 ) { player1 = player1 + 1; cout <<" player 1 beats player 2. " << endl; } else if ( a==3 && b==2 ) { player2 = player2 + 1; cout <<" player 2 beats player 1. " << endl; } cout <<"next round. " << endl; cout << " PLEASE ENTER THE CHOICES RESPECTIVELY. PLEASE ENTER 1 FOR SCISSOR, 2 FOR PAPER and 3 FROM ROCK." << endl ;ENTER 1 FOR SCISSOR, 2 FOR PAPER and 3 FROM ROCK....
View Full Document

This note was uploaded on 07/27/2011 for the course COL 201 taught by Professor Magtibay during the Winter '10 term at De La Salle Lipa.

Page1 / 3

paperrockstone3 - #include <iostream> using namespace...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online