We have a game named Pokemon. In this game, we will have two different pokemons Pikachu and Charmander and they will fight in a gym. In each turn, they will attack each other and decrease the opponent's health by its own attackPower. The game will finish when one of the pokemons die(it's health becomes smaller than or equal to 0.) After the game finish, your program will print the remaining health of the winner pokemon on the screen.
For example, Pikachu has 120 health, 55 attackPower and Charmander has 160 health, 35 attackPower.
We have already implemented the struct definition and final print operation for you. You will just read the healths and attackPowers of Pikachu and Charmander from the user and make necessary calculations. (PLEASE DO NOT UPDATE THE OUTSIDE OF THE COMMENTS)
Attention please, if you look at the implementation, we defined an additional pokemon called winnerPokemon and print the health of this pokemon at the end. This means that you must assign your victorious pokemon (Pikachu or Charmander) to this winnerPokemon variable.
Assumptions: There will be always a winner in fights. In other words, both of the pokemons will not die in the same turn.
Examples:INPUT | OUTPUT |
120 55 160 35 |
15 |
1080 120 1081 120 |
1 |
978 10 850 12 |
30 |
Important issues about all exams/projects/quizzes: