-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy path3-5.c
37 lines (34 loc) · 765 Bytes
/
3-5.c
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
#include<stdio.h>
int main() {
printf("[1] apple\n"
"[2] pear\n"
"[3] orange\n"
"[4] grape\n"
"[0] exit\n"
);
int a, k;
for (a = 0; a <= 4; a++) {
scanf("%d", &k);
if (k == 0) {
break;
}
switch (k) {
case 1:
printf("price = 3.00\n");
break;
case 2:
printf("price = 2.50\n");
break;
case 3:
printf("price = 4.10\n");
break;
case 4:
printf("price = 10.20\n");
break;
default:
printf("price = 0.00\n");
break;
}
}
return 0;
}