<mosaic.cnfolio.com>
PROGRAM
  1. /* Start
  2.    User input variables
  3.    pidgey
  4.    xp 500
  5.    
  6.    IF Statement
  7.    candy greater than 12 evolve pokemon
  8.    PRINT max pidgeys to be evolved
  9.    PRINT maximum xp
  10.    
  11.    ELSE
  12.    PRINT pidgey evolutions by pidgeys
  13.    PRINT maximum xp
  14.    END IF
  15.    
  16.    ELSE
  17.    PRINT not enough candy to evolve
  18.  
  19.    End
  20. */
  21. #include <stdio.h>
  22.  
  23. int main (void)
  24. {
  25.    /*Input variables*/
  26.    int pidgey;
  27.    int pidgey_candy;
  28.    int xp = 1000 ;
  29.    
  30.    
  31.    /*Scans input data from user */
  32.    scanf("%d %d", &pidgey, &pidgey_candy);
  33.    int evolution = pidgey_candy/12;
  34.    int candy = (xp  * evolution);
  35.    int maxXP = ( xp * pidgey);
  36.    
  37.   /*statement to evolve pidgey and work out maximum xp for evolution*/
  38.   if (pidgey_candy >= 12)
  39.   {
  40.       if (candy < maxXP)
  41.       {
  42.       printf("You can evolve %d pidgey's \n", evolution);
  43.       printf("Total xp earned is %d \n", candy);
  44.       }
  45.      
  46.       else
  47.       {
  48.       printf("pidgey's that can be evolved %d \n", maxXP/1000);
  49.       printf("Total xp earned is %d \n", candy);
  50.       }
  51.       }
  52.      
  53.     else
  54.       {
  55.        printf("you don't have enough candy to evolve your pidgey\n");
  56.        }
  57.    
  58. }