<mosaic.cnfolio.com>
PROGRAM
  1. /*
  2. START
  3.    GET values for number of Pidgey pokemon and Pidgey candy
  4.       IF Pidgey value > 0
  5.          IF candy value > or = 12
  6.             IF possible evolutions < or = pidgey
  7.                PRINT successful evolution calculation
  8.          ELSE
  9.             PRINT candy error
  10.       ELSE
  11.          PRINT pidgey error
  12. END
  13. */
  14.  
  15. #include <stdio.h>
  16.  
  17. int main( void )
  18.  
  19. {
  20.  
  21.    int pidgey, candy;
  22.  
  23.    scanf( "%d %d", &pidgey, &candy );
  24.    
  25.    if (pidgey > 0){
  26.      if (candy >= 12){         /* 12 candy required for evolution */
  27.        int possevolutions = candy / 12;
  28.        if ( possevolutions <= pidgey );      /* Error if less pidgeys than possible evolutions */
  29.        {
  30.    
  31.        printf( "%dXP gained through evolution!", possevolutions * 1000 );    /* Lucky egg = 1000XP per evolution */
  32.    
  33.        }
  34.      } else {
  35.        printf("Not enough Pidgy candy to evolve!");
  36.      }
  37.    } else {
  38.       printf("Not enough Pidgey Pokemon to evolve");
  39.    }
  40. }