-
Notifications
You must be signed in to change notification settings - Fork 2
/
2754.c
49 lines (42 loc) · 1003 Bytes
/
2754.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
38
39
40
41
42
43
44
45
46
47
48
49
// [ 백준 ] 2754번: 학점계산
#include <stdio.h>
int main(void)
{
char score[3];
scanf("%s", &score);
if (score[0] == 'A') {
if (score[1] == '+') {
printf("4.3");
} else if (score[1] == '0') {
printf("4.0");
} else {
printf("3.7");
}
} else if (score[0] == 'B') {
if (score[1] == '+') {
printf("3.3");
} else if (score[1] == '0') {
printf("3.0");
} else {
printf("2.7");
}
} else if (score[0] == 'C') {
if (score[1] == '+') {
printf("2.3");
} else if (score[1] == '0') {
printf("2.0");
} else {
printf("1.7");
}
} else if (score[0] == 'D') {
if (score[1] == '+') {
printf("1.3");
} else if (score[1] == '0') {
printf("1.0");
} else {
printf("0.7");
}
} else {
printf("0.0");
}
}