-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path1603.cpp
More file actions
48 lines (42 loc) · 982 Bytes
/
1603.cpp
File metadata and controls
48 lines (42 loc) · 982 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
48
#include <iostream>
#include <string>
#include <algorithm>
using namespace std;
string num[27] = {"one","two","three","four","five","six","seven","eight","nine","ten","eleven","twelve",
"thirteen","fourteen","fifteen","sixteen","seventeen","eighteen","nineteen","twenty","a","both","another","first","second","third"};
string sqare[27]={"01","04","09","16","25","36","49","64","81","100","21","44","69","96","25","56","89","24","61","00","01","04","01","01","04","09"};
int main()
{
string word[6];
string ans[6];
int len = 0;
for(int i=0;i<6;i++)
cin>>word[i];
for(int i=0;i<6;i++)
{
for(int j=0;j<26;j++)
{
if(word[i]==num[j])
ans[len++]=sqare[j];
}
}
sort(ans, ans+len);
if(len == 0)
cout<<"0";
else
{
for(int i=0;i<len;i++)
{
if(i==0)
{
if(ans[i]=="00")
continue;
else if(ans[i][0]=='0')
cout<<ans[i][1];
}
else if(i=0)
cout<<ans[i];
}
}
return 0;
}