-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathback_1076.cpp
More file actions
47 lines (40 loc) · 789 Bytes
/
back_1076.cpp
File metadata and controls
47 lines (40 loc) · 789 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
44
45
46
47
#include <iostream>
#include <cmath>
using namespace std;
int temp[3];
int main()
{
string input[3];
string color[10] = {"black", "brown", "red", "orange", "yellow", "green", "blue", "violet", "grey", "white"};
for (int i = 0; i < 3; i++)
{
cin >> input[i];
}
for (int i = 0; i < 3; i++)
{
for (int j = 0; j < 10; j++)
{
if (input[i] == color[j])
{
temp[i] = j;
break;
}
}
}
int num = temp[0] * 10 + temp[1];
if (num == 0)
{
cout << "0\n";
return 0;
}
else
{
cout << num;
for (int i = 0; i < temp[2]; i++)
{
cout << "0";
}
cout << "\n";
}
return 0;
}