A long long time ago, the sky was dark and gloomy, the ocean was deep and mysterious, and the continent was covered by lava and sandstorm. The mad wild world was dominated by what’s called Pokémon today. It’s a prehistoric era, where the ancient monsters were both arrogant and noble. But it will only last until the human–or whatever the so-called trainer is–comes.
These beautiful creatures are now puppets of a bunch of goddamn ten years old kids. They travel across countries to collect different species of Pokémon for their fetishism, for they are addicted to control, to dominate lives that cannot defy them. Thousands of thousands of innocent Pokémons got caught, imprisoned, and traded as goods.
And yet it’s not the worst. Like any civilization did to the slaves, trainers love to have their Pokémon battle against other trainers’ Pokémon. They compete with each other in their Pokémon battles and consider it glorious if they win, although all they do is sit and watch the poor Pokémons bleeding, burning to death.
Now as a Pokémon battle field manager, you are asked to report the battle process between two given Pokémons. We’ll dig into the details in the following.
In this problem, you are asked to implement 2 functions:
The following is “function.h”. It is guaranteed that the given Pokémon would only be one of the following 5 types: “Geodude”, “Raichu”, “Golbat”, “Magnemite”, and “Exeggutor”, indexed from 0 to 4.
For the function “recover”, you are going to cure a Pokémon, i.e. set Hp to maxHp.
For the function “battle”, you are going to simulate a battle process. Here are the details:
#include <stdio.h>
typedef struct pokemon{
int id;
char name[20];
char first_move[20];
char second_move[20];
int attack;
int special_attack;
int defense;
int special_defense;
int Hp;
int maxHp;
}Pokemon;
// TODO: recover the Pokémon
void recover(Pokemon *P);
// TODO: simulate and print the process of the battle
void battle(Pokemon *A, Pokemon *B);
The first line contains an integer n, representing the number of Pokémons.
The second line contains n integers xi, representing the type of each Pokémon.
The third line contains an integer t, representing the number of operations.
Then, t lines follow, each representing an operation.
Each operation is in the following forms:
1 id:
The id th Pokémon recovered.
2 a b:
Please print the battle process of the a th Pokémon and the b th Pokémon.
Execute each operation described in the statement above.
Check the sample output for more details.