<mosaic.cnfolio.com>
PROGRAM
  1. /*
  2. START
  3.  
  4.   Read input number of Pidgey Pokemon
  5.   Read input number of Pidgey's Candy
  6.   Read input number of Rattata Pokemon
  7.   Read input number of Ratatata's Candy
  8.   Read input number of Zubat Pokemon
  9.   Read input number of Zubat's Candy
  10.  
  11.   IF number of Pidgey'sCandy less than 12
  12.      THEN
  13.         IF number of Candy bigger and equal to 0
  14.      THEN
  15.            Display number of candy not enough
  16.      END IF
  17.   END IF
  18.  
  19.   IF number of Candy less than 0
  20.       THEN
  21.          Display error message number of Candy is not correct! It has to be positive value
  22.       END IF
  23.  
  24.   IF number of Pidgey equal to 0
  25.      THEN
  26.         Display number of Pidgey not enough
  27.      END IF
  28.  
  29.   IF number of Pidgey less than 0
  30.      THEN
  31.         Dispaly error message number of Pidgey is not correct! It has to be positive value
  32.      END IF
  33.  
  34.   IF (Candy-1)/11 is less than number of Pidgey
  35.    THEN
  36.       Evolved Pidgey = (Candy-1)/11
  37.       Not evolved Pidgey = Pidgey - Evolved Pidgey
  38.            Earned Candy = Evolved Pidgey
  39.       Number of left Candy after evolution = Candy + Evolved Pidgey - (12*Evolved Pidgey)
  40.       Maximum amount of XP = Evolved Pidgey*2*500
  41.    ELSE
  42.       IF (Candy-1)/11 is bigger than number of Pidgey
  43.       THEN
  44.          Evolved Pidgey = Pidgey
  45.               Not evolved Pidgey = Pidgey - Evolved Pidgey
  46.                    Earned Candy = Evolved Pidgey
  47.               Number of left Candy after evolution = Candy + Evolved Pidgey - (12*Evolved Pidgey)
  48.               Maximum amount of XP = Evolved Pidgey*2*500
  49.       ELSE
  50.          IF (Candy-1)/11 is equall number of Pidgey
  51.          THEN
  52.             volved Pidgey = Pidgey
  53.                   Not evolved Pidgey = Pidgey - Evolved Pidgey
  54.                         Earned Candy = Evolved Pidgey
  55.                Number of left Candy after evolution = Candy + Evolved Pidgey - (12*Evolved Pidgey)
  56.                   Maximum amount of XP = Evolved Pidgey*2*500
  57.          END IF
  58.       END IF
  59.   END IF
  60.  
  61. IF number of Rattata's Candy less than 25
  62.      THEN
  63.         IF number of Candy bigger and equal to 0
  64.      THEN
  65.            Display number of Rattata's candy not enough
  66.      END IF
  67.   END IF
  68.  
  69.   IF number of Rattata's Candy less than 0
  70.       THEN
  71.          Display error message number of Rattata's Candy is not correct! It has to be positive value
  72.       END IF
  73.  
  74.   IF number of Rattata equal to 0
  75.      THEN
  76.         Display number of Rattata not enough
  77.      END IF
  78.  
  79.   IF number of Rattata less than 0
  80.      THEN
  81.         Dispaly error message number of Rattata is not correct! It has to be positive value
  82.      END IF
  83.  
  84.   IF (Rattata's Candy-1)/24 is less than number of Rattata
  85.    THEN
  86.       Evolved Rattata = (Rattata's Candy-1)/24
  87.       Not evolved Rattata = Rattata - Evolved Rattata
  88.            Earned Candy = Evolved Rattata
  89.       Number of left Candy after evolution = Rattata's Candy + Evolved Rattata - (25*Evolved Rattata)
  90.       Maximum amount of XP = Evolved Rattata*2*500
  91.    ELSE
  92.       IF (Rattata's Candy-1)/24 is bigger than number of Rattata
  93.       THEN
  94.          Evolved Rattata = Rattata
  95.               Not evolved Rattata = Rattata - Evolved Rattata
  96.                    Earned Candy = Evolved Rattata
  97.               Number of left Candy after evolution = Rattata's Candy + Evolved Rattata - (25*Evolved Rattata)
  98.               Maximum amount of XP = Evolved Rattata*2*500
  99.       ELSE
  100.          IF (Candy-1)/24 is equall number of Rattata
  101.          THEN
  102.             volved Rattata = Rattata
  103.                   Not evolved Rattata = Rattata - Evolved Rattata
  104.                         Earned Candy = Evolved Rattata
  105.                Number of left Candy after evolution = Rattata's Candy + Evolved Rattata - (25*Evolved Rattata)
  106.                   Maximum amount of XP = Evolved Rattata*2*500
  107.          END IF
  108.       END IF
  109.   END IF
  110.   IF number of Zubat's Candy less than 50
  111.      THEN
  112.         IF number of Zubat's Candy bigger and equal to 0
  113.      THEN
  114.            Display number of Zubat's candy not enough
  115.      END IF
  116.   END IF
  117.  
  118.   IF number of Zubat's Candy less than 0
  119.       THEN
  120.          Display error message number of Zubat's Candy is not correct! It has to be positive value
  121.       END IF
  122.  
  123.   IF number of Zubat equal to 0
  124.      THEN
  125.         Display number of Zubat not enough
  126.      END IF
  127.  
  128.   IF number of Zubat less than 0
  129.      THEN
  130.         Dispaly error message number of Zubat is not correct! It has to be positive value
  131.      END IF
  132.  
  133.   IF (Zubat's Candy-1)/49 is less than number of Zubat
  134.    THEN
  135.       Evolved Zubat = (Zubat's Candy-1)/49
  136.       Not evolved Zubat = Zubat - Evolved Zubat
  137.            Earned Candy = Evolved Zubat
  138.       Number of left Candy after evolution = Zubat's Candy + Evolved Zubat - (50*Evolved Zubat)
  139.       Maximum amount of XP = Evolved Zubat*2*500
  140.    ELSE
  141.       IF (Zubat's Candy-1)/49 is bigger than number of Zubat
  142.       THEN
  143.          Evolved Zubat = Zubat
  144.               Not evolved Zubat = Zubat - Evolved Zubat
  145.                    Earned Candy = Evolved Zubat
  146.               Number of left Candy after evolution = Zubat's Candy + Evolved Zubat - (50*Evolved Zubat)
  147.               Maximum amount of XP = Evolved Zubat*2*500
  148.       ELSE
  149.          IF (Zubat's Candy-1)/49 is equall number of Zubat
  150.          THEN
  151.             volved Zubat = Zubat
  152.                   Not evolved Zubat = Zubat - Evolved Zubat
  153.                         Earned Candy = Evolved Zubat
  154.                Number of left Candy after evolution = Zubat's Candy + Evolved Zubat - (50*Evolved Zubat)
  155.                   Maximum amount of XP = Evolved Zubat*2*500
  156.          END IF
  157.       END IF
  158.   END IF
  159.  
  160. END
  161. */
  162. #include <stdio.h>
  163.  
  164. int main(void)
  165. {
  166. int Pidgey;
  167. int Candy;         
  168. int Evolved;
  169. int EvPid;        /*Number of Pidgey that has been evolved */
  170. int ECandy;       /*Number of earned candy after evolution process*/
  171. int NCandy;       /*Number of left candy after the evolution process*/
  172. int NoEvPid;      /*Number of Pidgey that has not been evolved*/
  173. int XP;           /*Maximum amount of experience points that a Pokémon Go player can earn by using a Lucky Egg bonus*/
  174. int Rat;          /*Number of Rattata*/
  175. int RatC;         /*Number of entered candies that Rattata's Pokemon needs */
  176. int EvRat;        /*Number of Rattata that has been evolved */
  177. int XPR;          /*Maximum amount of experience points that a Pokémon Go player can earn by using a Lucky Egg bonus for Rattata*/
  178. int ECanR;        /*Number of earned candy after evolution process*/
  179. int NoEvRat;      /*Number of Rattata that has NOT been evolved */
  180. int NCanR;        /*Number of left Rattata's Candy after the evolution process*/
  181. int Zub;          /*Number of Zubat*/
  182. int ZubC;         /*Number of entered candies that Zubat's Pokemon needs */
  183. int EvZub;        /*Number of Zubat that has been evolved */
  184. int XPZ;          /*Maximum amount of experience points that a Pokémon Go player can earn by using a Lucky Egg bonus for Zubat*/
  185. int ECanZ;        /*Number of earned candy after evolution process*/
  186. int NoEvZ;        /*Number of Zubat that has NOT been evolved */
  187. int NCanZ;        /*Number of left Zubat's Candy after the evolution process*/
  188.  
  189.  
  190. printf("Enter number of Pidgey:\nEnter number of Pidgey's Candy:\n\n");
  191. scanf("%d %d", &Pidgey, &Candy);
  192. printf("Enter number of Rattata:\nEnter number of Rattata's Candy:\n\n");
  193. scanf("%d %d", &Rat, &RatC);
  194. printf("Enter number of Zubat:\nEnter number of Zubat's Candy:\n\n");
  195. scanf("%d %d", &Zub, &ZubC);
  196.  
  197.   if (Pidgey==0)
  198.   {
  199.    printf("Sorry!!\nNumber of Pidgies are not enough\nTry again later:)\n\n\n");
  200.   }
  201.  
  202.   if (Pidgey<0)
  203.   {
  204.    printf("Error message:\nNumber of Pidgies are not correct\nIt has to be positive number\n\n\n");
  205.   }
  206.   if ((Candy>=0)&&(Candy<12))
  207.   {
  208.    printf("Sorry!!\nNumber of Pidgey's Candies are not enough\nTry again later:)\n\n\n");
  209.   }
  210.  
  211.   if (Candy<0)
  212.   {
  213.    printf("Error message:\nNumber of Pidgey's Candies are not correct!\nIt has to be positive number\n\n\n");
  214.   }
  215.  
  216.   else if ((Candy-1)/11 < Pidgey)
  217.   {
  218.    printf("Number of Pidgies that has been evolved is %d\n", EvPid=(Candy-1)/11);
  219.    printf("Number of Pidgies that has NOT been evolved is %d\n", NoEvPid=Pidgey-EvPid);
  220.    printf("Number of Candy earend after evolutioin %d\n", ECandy=EvPid);
  221.    printf("Number of Candy left %d\n", NCandy=Candy+EvPid-(12*EvPid));
  222.    printf("Maximum amount of experience points (XP) is %d\n\n", XP=EvPid*2*500);                                                                   
  223.   }
  224.  
  225.  
  226.   else if ((Candy-1)/11 > Pidgey)
  227.   {
  228.    printf("Number of Pidgies that has been evolved is %d\n", EvPid=Pidgey);
  229.    printf("Number of Pidgies that has NOT been evolved is %d\n", NoEvPid=Pidgey-EvPid);
  230.    printf("Number of Candy earend after evolutioin %d\n", ECandy=EvPid);
  231.    printf("Number of Candy left %d\n", NCandy=Candy+EvPid-(12*EvPid));
  232.    printf("Maximum amount of experience points (XP) is %d\n\n", XP=EvPid*2*500);
  233.   }   
  234.  
  235.  
  236.   else if ( (Candy-1)/11 == Pidgey)
  237.   {
  238.    printf("Number of Pidgies that has been evolved is %d\n", EvPid=Pidgey);
  239.    printf("Number of Pidgies that has NOT been evolved is %d\n", NoEvPid=Pidgey-EvPid);
  240.    printf("Number of Candy earend after evolutioin %d\n", ECandy=EvPid);
  241.    printf("Number of Candy left %d\n", NCandy=Candy+EvPid-(12*EvPid));
  242.    printf("Maximum amount of experience points (XP) is %d\n\n", XP=EvPid*2*500);
  243.   }
  244. if (Rat<0)
  245.   {
  246.    printf("\nError message:\nNumber of Rattata's Pokemon are not correct!\nIt has to be positive number\n\n\n");
  247.   }
  248.  
  249. if (Rat==0)
  250.   {
  251.    printf("\nSorry!!\nNumber of Rattat's Pokemon are not enough\nTry again later:)\n\n");
  252.   }
  253.  
  254. if ((RatC>=0)&&(RatC<24))
  255.   {
  256.    printf("\nSorry!!\nNumber of Rattata's Candies are not enough\nTry again later:)\n\n");
  257.   }
  258.  
  259. if (RatC<0)
  260.   {
  261.       printf("\nError message:\nNumber of Rattata's Candies are not correct!\nIt has to be positive number\n\n\n");
  262.   }
  263.  
  264.   else if ((RatC-1)/24 < Rat)
  265.   {
  266.    printf("Number of Rattata that has been evolved is %d\n", EvRat=(RatC-1)/24);
  267.    printf("Number of Rattata that has NOT been evolved is %d\n", NoEvRat=Rat-EvRat);
  268.    printf("Number of Candy earend after evolutioin %d\n", ECanR=EvRat);
  269.    printf("Number of Candy left %d\n", NCanR=RatC+EvRat-(25*EvRat));
  270.    printf("Maximum amount of experience points (XP) is %d\n\n", XPR=EvRat*2*500);                                                                   
  271.   }
  272.  
  273.  
  274.   else if ((RatC-1)/24 > Rat)
  275.   {
  276.    printf("Number of Rattata that has been evolved is %d\n", EvRat=Rat);
  277.    printf("Number of Rattata that has NOT been evolved is %d\n", NoEvRat=Rat-EvRat);
  278.    printf("Number of Candy earend after evolutioin %d\n", ECanR=EvRat);
  279.    printf("Number of Candy left %d\n", NCanR=RatC+EvRat-(25*EvRat));
  280.    printf("Maximum amount of experience points (XP) is %d\n\n", XPR=EvRat*2*500);
  281.   }   
  282.  
  283.  
  284.   else if ( (RatC-1)/24 == Rat)
  285.   {
  286.    printf("Number of Rattata that has been evolved is %d\n", EvRat=Rat);
  287.    printf("Number of Rattata that has NOT been evolved is %d\n", NoEvRat=Rat-EvRat);
  288.    printf("Number of Candy earend after evolutioin %d\n", ECanR=EvRat);
  289.    printf("Number of Candy left %d\n", NCanR=RatC+EvRat-(25*EvRat));
  290.    printf("Maximum amount of experience points (XP) is %d\n\n", XPR=EvRat*2*500);
  291.   }
  292. if (Zub<0)
  293.   {
  294.    printf("\nError message:\nNumber of Zubat's Pokemon are not correct!\nIt has to be positive number\n\n\n");
  295.   }
  296.  
  297. if (Zub==0)
  298.   {
  299.    printf("\nSorry!!\nNumber of Zubat's Pokemon are not enough\nTry again later:)\n\n");
  300.   }
  301.  
  302. if ((ZubC>=0)&&(ZubC<49))
  303.   {
  304.    printf("\nSorry!!\nNumber of Zubat's Candies are not enough\nTry again later:)\n\n");
  305.   }
  306.  
  307. if (ZubC<0)
  308.   {
  309.       printf("\nError message:\nNumber of Zubat's Candies are not correct!\nIt has to be positive number\n\n\n");
  310.   }
  311.  
  312.   else if ((ZubC-1)/49 < Zub)
  313.   {
  314.    printf("Number of Zubat that has been evolved is %d\n", EvZub=(ZubC-1)/49);
  315.    printf("Number of Zubat that has NOT been evolved is %d\n", NoEvZ=Zub-EvZub);
  316.    printf("Number of Candy earend after evolutioin %d\n", ECanZ=EvZub);
  317.    printf("Number of Candy left %d\n", NCanZ=ZubC+EvZub-(50*EvZub));
  318.    printf("Maximum amount of experience points (XP) is %d\n\n", XPZ=EvZub*2*500);                                                                   
  319.   }
  320.  
  321.  
  322.   else if ((ZubC-1)/49 > Zub)
  323.   {
  324.    printf("Number of Zubzt that has been evolved is %d\n", EvZub=Zub);
  325.    printf("Number of Zubat that has NOT been evolved is %d\n", NoEvZ=Zub-EvZub);
  326.    printf("Number of Candy earend after evolutioin %d\n", ECanZ=EvZub);
  327.    printf("Number of Candy left %d\n", NCanZ=ZubC+EvZub-(50*EvZub));
  328.    printf("Maximum amount of experience points (XP) is %d\n\n", XPZ=EvZub*2*500);
  329.   }   
  330.  
  331.  
  332.   else if ( (ZubC-1)/49 == Zub)
  333.   {
  334.    printf("Number of Zubzt that has been evolved is %d\n", EvZub=Zub);
  335.    printf("Number of Zubzt that has NOT been evolved is %d\n", NoEvZ=Zub-EvZub);
  336.    printf("Number of Candy earend after evolutioin %d\n", ECanZ=EvZub);
  337.    printf("Number of Candy left %d\n", NCanZ=ZubC+EvZub-(50*EvZub));
  338.    printf("Maximum amount of experience points (XP) is %d\n\n", XPZ=EvZub*2*500);
  339.   }
  340. }