<mosaic.cnfolio.com>
PROGRAM
1. /*
2. START
3. Enter two intergers input1, input2
4. Calculate number of evolutions
5. Calculate maximum experience points
6. IF pidgeys is less than number of evolutions
7.       THEN
8.          Maximum XP equal to XP for evolutions*luckyegg*pigdeys
9. END IF
10. IF pidgeys is greater than number of evolutions
11.       THEN
12.          Maximum XP equal to XP for evolution*luckyegg*numofevolutions
13. END IF
14. IF  pidgeys is less than 0
15.       THEN
16.          Maximum XP is 0 and display error messagae "not enough pidgeys"
17. END IF
18. IF pidgeys are equal 0
19.       THEN
20.          Maximum XP is 0 and display error message "not enough pidgeys"
21. END IF
22. IF candies less than 0
23.       THEN
24.       Then Maximum XP is 0 and display error message "not enough candies"
25. END IF
26. IF candies are equal to 0
27.       THEN Maximum XP is 0 and display error message "not enough candies"
28. END IF
29. Display Maximum XP
30. END
31. */
32.
33.
34. #include <stdio.h>
35.
36. int main (void)
37. {
38.    int input1 = 0;// input1 is pidgeys
39.    int input2 = 0;// input2 is candies
40.    int maxXP;
41.    int numofevolutions;
42.
43.    scanf("%d %d", &input1, &input2)
44.    numofevolutions = input2/12 ;// 12 candies for 1 evolution
45.    maxXP = 500*2*numofevolutions;
46.
47.
48.    if (input1 < numofevolutions)
49.    {
50.       maxXP = 500*2*input1;// 2 is representing lucky egg bonus
51.    }
52.    if (input1 > numofevolutions)
53.    {
54.       maxXP = 500*2*numofevolutions;// 500 is representing the XP for evole
55.    }
56.
57.    if (input1 < 0)
58.    {
59.       maxXP = 0;
60.       fprintf(stderr, "Error: You dont have enough pidgeys\n");
61.    }
62.
63.    if (input1 == 0)
64.    {
65.       maxXP = 0;
66.       fprintf(stderr, "Error: You dont have enough pidgeys\n");
67.    }
68.
69.    if (input2 < 0)
70.    {
71.       maxXP = 0;
72.       fprintf(stderr, "Error: You dont have enough candies\n");
73.    }
74.
75.    if (input2 == 0)
76.    {
77.       maxXP = 0;
78.       fprintf(stderr, "Error: You dont have enough candies\n");
79.    }
80.
81.
82.
83. printf("max XP = %d",maxXP);
84. }