<mosaic.cnfolio.com>
PROGRAM
  1. /*
  2. START
  3. INPUT
  4.    Number of Pidgey Pokemon as Integer
  5.    Number of Pidgey Candy as Integer
  6. STORE
  7.    XP as 500
  8.    Pidgey Evolution as Integer by Candy, Total Candy Divided by 12
  9.    Max XP Candy as Integer, XP * 2 * Pidgey Evolution
  10.    Max XP Pidgey as Integer, XP * 2 * Pidgey
  11.    Pidgey Evolution as Integer by Pidgey's, Max XP Pidgey Divided by 1000
  12. IF Pidgey >= 1 THEN
  13.    IF Pidgey Candy >= 12 THEN
  14.       IF Max XP Candy < Max XP Pidgey THEN
  15.          PRINT
  16.             Total number of Pidgey Evolutions by Candy
  17.             Maximum XP earned by Candy
  18.       ELSE
  19.          PRINT
  20.             Total number of Pidgey Evolutions by Pidgey's
  21.             Maximum XP earned by Pidgey's
  22.       END IF
  23.    ELSE
  24.       PRINT
  25.          Not enough candy to evolve a Pidgey
  26.    END IF
  27. ELSE
  28.    PRINT
  29.       Not enough Pidgey's for evolutions
  30. END IF
  31. END
  32. */
  33. #include <stdio.h>
  34.  
  35. int main(void)
  36. {
  37. int pidgey; /* This is the Pidgey Input Variable */
  38. int pidgeyCandy; /* This is the Pidgey Candy Input Variable */
  39.  
  40. scanf("%d %d", &pidgey, &pidgeyCandy); /* This reads the inputs */
  41. int xp=500; /* Declaring xp as 500 */
  42. int candyEvolution = pidgeyCandy/12; /* Calculating the Number of Evolutions by Candy */
  43. int maxXpCandy=(xp * 2 * candyEvolution); /* Calculating the Maximum XP earned by Candy */
  44. int maxXpPidgey=(xp * 2 * pidgey); /* Calculating the Maximum XP earned by Pidgey's */
  45. int pidgeyEvolution = maxXpPidgey/1000; /* Calculating the Number of Evolutions by Pidgey's */
  46.  
  47. if (pidgey >= 1) /* If statement whether Pidgey is greater than or equal to 1 */
  48. {
  49.   if (pidgeyCandy >= 12) /* If statement whether Pidgey Candy is greater than or equal to 12 */
  50.   {
  51.     if (maxXpCandy < maxXpPidgey)  /* If statement whether Maximum Candy XP is less than Maximum Pidgey XP */
  52.       {
  53.          printf("The total number of Pidgey's that can be evolved depending on the candy is %d \n", candyEvolution); /* Prints the number of Pidgey's that can be evolved depending on the number of candy */
  54.          printf("The maximum amount of XP that can be earned with a lucky egg is %d \n", maxXpCandy); /* Prints the maximum amount of XP that can be earned depending on the number of candy */
  55.       }
  56.       else   
  57.       {
  58.          printf("The total number of Pidgey's that can be evolved depending on the number of Pidgey is %d \n", pidgeyEvolution); /* Prints the number of Pidgey's that can be evolved depending on the number of pidgey's */
  59.           printf("The maximum amount of XP that can be earned with a lucky egg is %d", maxXpPidgey); /* Prints the maximum amount of XP that can be earned depending on the number of pidgey's  */
  60.       }
  61.   }
  62.    else
  63.    {
  64.       printf("You have not got enough candy to evolve a Pidgey."); /* Prints error message */
  65.       }
  66.       }
  67. else
  68.    {
  69.    printf("You have not got enough Pidgey's for any evolutions."); /* Prints error message */
  70.    }
  71. }