3rd BUBT Intra-University Programming Problem E

Problem E
Ball Passing Game
Input: standard input   Output: standard output
The Problem


In this game there are two players Player-1and Player-2 and a certain round N. Before the start of the game which player starts the game will be told.
Say, player Player-1 starts the game and passes ball to player Player-2  and then player Player-2 passes the ball to player Player-1 and this process is continued for a certain round N.
You have to find out which player will have the ball after N rounds.


Input
There are two inputs in each line. The first input is a number (1 or 2) represents which player will start the game. The second input is an integer N represents how many rounds to be played.
Output
Your program should output a line containing which player will have the ball after N rounds. As shown in the sample output.
Sample Input
1   5
2   5
1   4
Sample Output
Player-2 will have the ball after 5 rounds.
Player-1 will have the ball after 5 rounds.
Player-1 will have the ball after 4 rounds.
_______________________________________________________________________
Problem Setter: Md. Joshim Uddin, Dept. of CSE
Bangladesh University of Business and Technology (BUBT)
At First you can try to solve this problem if you can’t than see this code & find what’s your problem . If you copy paste this code you could not improve yourself in programming .

Posted by Shipu Ahamed

Leave a Reply