Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- #include<string.h>
- //MATRICES DE ESTRUCTURAS
- #define ELEMENTOS 6
- struct estructura_pokemon{
- char pokemon[50];
- char tipo[50];
- int health;
- int edad;
- };
- struct estructura_pokemon pokemon[ELEMENTOS]={{"Pikachu","Electrico",300,4},
- {"Bulbasaur","Planta",350,4},{"Charizard","Fuego",500,4},//Le entregamos valores a cada una de nuestras estructuras de la lista
- {"Glaceon","Hielo",400,4},{"Caterpie","Bicho",5000,4},
- {"Squirtle","Agua",350,4}
- };
- int main(){
- int num_pokemon;
- int n;
- /* impresion de los datos */
- printf("escoja su pokemon(1)(2)(3).\n");
- scanf("%d",&n);
- printf("el pokemon que usted ha elegido es: \n");
- printf("%s\n",pokemon[n].pokemon);
- printf("es del tipo: %s\n",pokemon[n].tipo);
- printf("PP: %d\n",pokemon[n].health);
- printf("EFECTO: %i \n",pokemon[n].edad);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement