<mosaic.cnfolio.com>
PROGRAM
  1. /*
  2. START
  3.  
  4.   Obtain number of candies
  5.   If number of candies is greater then 0
  6.   Then
  7.   proceed
  8.   Else
  9.   Display error
  10.  
  11.   obtain number of pidgies
  12.   If number of pidgies is greater then 0
  13.   Then
  14.   proceed
  15.   Else
  16.   Display error
  17.  
  18.   else if number of candies is less then required number of candies to evolve pokemon
  19.   Display
  20.   the number of pokemons evolved and remaining candies & pidgies
  21.   else if number of candies is more or equal to to the required number of candies to evolve pokemon
  22.   Display
  23.   the number of pokemon evolved and the remaining numbr of candies & pidgies
  24.  
  25.  
  26.       End if
  27.    End if
  28. End if
  29.  
  30. display the total amount of experience (xp) points the user has gained by evolving his pokemons including
  31.   the lucky egg bonus.
  32.  
  33. END
  34.  
  35.  
  36.  
  37. */
  38.  
  39.  
  40.  
  41. #include <stdio.h>
  42.  
  43.  
  44. int main (void)
  45.  
  46. {
  47. int candies; /* number of candies*/
  48. int pidgies;/*numbr of pidgies*/
  49. int evolvedpidgies; /*number of evolved pidigies*/
  50. int XP; /*experience points gained*/
  51. int remainingpidgies; /* number of remaining pidgies*/
  52.  
  53. scanf("%d", &candies);
  54. printf("enter number of candies:%d\n");
  55. scanf("%d",&pidgies);
  56. printf("Enter number of pidgies:%d\n ");
  57.  
  58.  
  59. if ( candies<0)
  60. {
  61. printf("error, your value is negative:\n");
  62. }
  63. if  ( ( candies < 12)&&(candies >=0) )
  64. {
  65. printf( " You do not have enough Candies :\n" );
  66. }
  67.  
  68. if ( pidgies <0)
  69. {
  70. printf( "error, your value is negative:\n" );
  71. }
  72.  
  73. if (pidgies==0)
  74. {
  75. printf ("you do not have enough pidgies!:\n");
  76. }
  77.  
  78.  
  79.  
  80.   else if (candies < (11*pidgies)+1)
  81.   {
  82.   printf(" number of evolved pidgies = %d\n", evolvedpidgies=candies/12);
  83.   printf("XP gained from evolving = %d\n", XP=evolvedpidgies*1000);
  84.   printf("number of remaining candies = %d:\n", candies-(11*pidgies+1));
  85.   printf("number of remaining pidgies = %d:\n" , pidgies-evolvedpidgies);
  86.  
  87.   }
  88.  
  89.    else if  (candies >= (11*pidgies)+1)
  90.   {
  91.   printf("number of evolved pidgies = %d\n", evolvedpidgies=pidgies);
  92.   printf("XP gained from evolving = %d\n", XP=evolvedpidgies*1000);
  93.   printf("number of remaining candies = %d:\n", candies-(11*pidgies+1));
  94.   printf("number of remaining pidgies = %d:\n" , pidgies-evolvedpidgies);
  95.   }
  96.   exit (0);
  97.   return (0);
  98.  
  99. }
  100.  
  101.  
  102.  
  103.  
  104. /* for rattata */
  105.  
  106. /*
  107. int candies;  number of candies
  108. int rattata;numbr of ratatta
  109. int evolvedratatta; number of evolved ratatta
  110. int XP; experience points gained
  111. int remainingrattata;  number of remaining ratatta
  112.  
  113. scanf("%d", &candies);
  114. printf("enter number of candies:%d\n");
  115. scanf("%d",&ratatta);
  116. printf("Enter number of ratatta:%d\n ");
  117.  
  118.  
  119. if ( candies<0)
  120. {
  121. printf("error, your value is negative:\n");
  122. }
  123. if  ( ( candies < 25)&&(candies >=0) )
  124. {
  125. printf( " You do not have enough Candies :\n" );
  126. }
  127.  
  128. if ( ratatta <0)
  129. {
  130. printf( "error, your value is negative:\n" );
  131. }
  132.  
  133. if (ratatta==0)
  134. {
  135. printf ("you do not have enough ratatta!:\n");
  136. }
  137.  
  138.  
  139.  
  140.   else if (candies < (24*ratatta)+1)
  141.   {
  142.   printf(" number of evolved ratatta = %d\n", evolvedratatta=candies/25);
  143.   printf("XP gained from evolving = %d\n", XP=evolvedratatta*1000);
  144.   printf("number of remaining candies = %d:\n", candies-(24*ratatta+1));
  145.   printf("number of remaining ratatta= %d:\n" , ratatta-evolvedpratatta);
  146.  
  147.   }
  148.  
  149.    else if  (candies >= (24*ratatta+1)
  150.   {
  151.   printf("number of evolved ratatta = %d\n", evolvedratatta=ratatta);
  152.   printf("XP gained from evolving = %d\n", XP=evolvedratatta*1000);
  153.   printf("number of remaining candies = %d:\n", candies-(24*ratatta+1));
  154.   printf("number of remaining ratatta = %d:\n" , ratatta-evolvedratatta;
  155.  
  156. }
  157. */