-
Notifications
You must be signed in to change notification settings - Fork 0
/
2(1076).c
50 lines (41 loc) · 1.72 KB
/
2(1076).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
50
#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <string.h>
int main() {
char first[8], second[8], third[8];
long long num = 0;
scanf("%s", first);
if (strcmp(first, "black") == 0) num += 0;
else if (strcmp(first, "brown") == 0) num += 10;
else if (strcmp(first, "red") == 0) num += 20;
else if (strcmp(first, "orange") == 0) num += 30;
else if (strcmp(first, "yellow") == 0) num += 40;
else if (strcmp(first, "green") == 0) num += 50;
else if (strcmp(first, "blue") == 0) num += 60;
else if (strcmp(first, "violet") == 0) num += 70;
else if (strcmp(first, "grey") == 0) num += 80;
else if (strcmp(first, "white") == 0) num += 90;
scanf("%s", second);
if (strcmp(second, "black")==0) num += 0;
else if (strcmp(second, "brown")==0) num += 1;
else if (strcmp(second, "red")==0) num += 2;
else if (strcmp(second, "orange")==0) num += 3;
else if (strcmp(second, "yellow")==0) num += 4;
else if (strcmp(second, "green")==0) num += 5;
else if (strcmp(second, "blue")==0) num += 6;
else if (strcmp(second, "violet")==0) num += 7;
else if (strcmp(second, "grey")==0) num += 8;
else if (strcmp(second, "white")==0) num += 9;
scanf("%s", third);
if (strcmp(third, "black")==0) num *= 1;
else if (strcmp(third, "brown")==0) num *= 10;
else if (strcmp(third, "red")==0) num *= 100;
else if (strcmp(third, "orange")==0) num *= 1000;
else if (strcmp(third, "yellow")==0) num *= 10000;
else if (strcmp(third, "green")==0) num *= 100000;
else if (strcmp(third, "blue")==0) num *= 1000000;
else if (strcmp(third, "violet")==0) num *= 10000000;
else if (strcmp(third, "grey")==0) num *= 100000000;
else if (strcmp(third, "white")==0) num *= 1000000000;
printf("%lld", num);
}