<mosaic.cnfolio.com>
PROGRAM
  1. /*
  2.    START
  3. INPUT amount of pokemon
  4. INPUT amount of pidgey candies
  5.    THEN
  6. Calculate the number of evoulutions you can make
  7.    IF pidgey candy more that 12 
  8. Calculate the maximum number of xp based on the amount of pidgey candy available
  9. Calculate the maximum number of xp based on the amount of pidgey pokemons available
  10.    END IF
  11. PRINT'you can evolve  pidgey pokemons'
  12. PRINT'maximum amount of xp earned'
  13.    ELSE
  14. PRINT'The amount of pidgeycandy is not enough'
  15.    END IF
  16.       ELSE
  17. PRINT'you don't have a pidgey pokemon to make an evolution'
  18.    END IF
  19.       END
  20. */
  21.  
  22.  
  23. #include <stdio.h>
  24. int main(void)
  25. {
  26. int  pidgey_pokemon; /* the amount of pidgey pokemon you input*/
  27. int pidgey_candy; /* the amount of pidgey candies you input*/
  28. int xp=500; /* you gain 500xp for evolving eaching pokemon*/
  29. int lucky_egg=2; /* the lucky egg will double the amount of xp gained after the evolution*/
  30.  
  31.  
  32. scanf("%d %d",&pidgey_pokemon,&pidgey_candy);
  33. int evolution= pidgey_candy/12; /*this will determine the amount of pidgey pokemons you can evolve*/
  34. int maXxp_using_candy= (xp * 2 * evolution);
  35. int maXxp_using_pidgeypokemon= (xp*2*pidgey_pokemon);
  36.  
  37. if (pidgey_pokemon >=1)
  38. {
  39.    if (pidgey_candy>12) /* if the amount of candy is greater than 12 then you can make an evolution*/
  40.    {
  41.     if (maXxp_using_candy < maXxp_using_pidgeypokemon) /*this will determin whether the calculation will be based on the amount of pidgey pokemons or candy*/
  42.       {
  43.          printf("You can only evolve %d pokemons \n", pidgey_candy/12);
  44.          printf("You have earned %d xp", maXxp_using_candy)/*this will calculate the xp based on the amount of candy you have*/
  45.       }
  46.      
  47.       else
  48.       {
  49.          printf("You can only evolve %d pokemons \n", maXxp_using_pidgeypokemon/1000);
  50.          printf("You have earned %d xp",maXxp_using_pidgeypokemon); /*this will calculate the xp based on the amount pf pokemons you have*/
  51.       }
  52.       }
  53.    else
  54.      {
  55.       printf("The amount of pidgey_candy is not enough"); /*if the amount of pidgey candy is less than 12 then you can't make an evolution*/
  56.      }
  57.      }
  58. else
  59.    {
  60.       printf("you don't have a pidgey pokemon to make an evolution");
  61.    }
  62.      
  63.  
  64. }