Advertisement
claudiorain25

escogerpokemon

Jun 26th, 2019
180
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.84 KB | None | 0 0
  1. #include<stdio.h>
  2. #include<string.h>
  3. //MATRICES DE ESTRUCTURAS
  4. #define ELEMENTOS 6
  5. struct estructura_pokemon{
  6.     char pokemon[50];
  7.     char tipo[50];
  8.     int health;
  9.     int edad;
  10. };
  11. struct estructura_pokemon pokemon[ELEMENTOS]={{"Pikachu","Electrico",300,4},
  12. {"Bulbasaur","Planta",350,4},{"Charizard","Fuego",500,4},//Le entregamos valores a cada una de nuestras estructuras de la lista
  13. {"Glaceon","Hielo",400,4},{"Caterpie","Bicho",5000,4},
  14. {"Squirtle","Agua",350,4}
  15. };
  16.  
  17. int main(){
  18.     int num_pokemon;
  19.     int n;
  20.    
  21.      
  22. /* impresion de los datos */
  23.  
  24.  printf("escoja su pokemon(1)(2)(3).\n");
  25.  scanf("%d",&n);
  26.  printf("el pokemon que usted ha elegido es: \n");
  27.  printf("%s\n",pokemon[n].pokemon);
  28.  printf("es del tipo: %s\n",pokemon[n].tipo);  
  29.  printf("PP: %d\n",pokemon[n].health);
  30.  printf("EFECTO: %i \n",pokemon[n].edad);
  31.  
  32. return 0;
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement