-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy path1283.c
More file actions
43 lines (36 loc) · 627 Bytes
/
1283.c
File metadata and controls
43 lines (36 loc) · 627 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#include <stdio.h>
int main()
{
int b, data, i;
double a, income;
scanf("%lf %d", &a, &b);
income = a;
for (i = 1; i <= b; i++)
{
scanf("%d", &data);
if (data == 0)
{
continue;
}
else
{
income = income * (1 + (double)data / 100);
}
}
if (income < a)
{
printf("%.0lf\n", income - a);
printf("bad");
}
else if (income > a)
{
printf("%.0lf\n", income - a);
printf("good");
}
else
{
printf("0\n");
printf("same");
}
return 0;
}