寒冰大大 @ 2017-12-23 13:29:12
#include<iostream>
#include<cmath>
#include<string>
#include<algorithm>
#include<map>
using namespace std;
bool cmp(string a, string b){
return a+ b > b + a;
}
map <string, string> k;
string num[10];
string t="";
int main(){
int i,j;
k["zero"] ="00";
k["one"] = "01";
k["two"] = "04";
k["three"] = "09";
k["four"] = "16";
k["five"] = "25";
k["six"] = "36";
k["seven"] = "49";
k["eight"] = "64";
k["nine"] = "81";
k["ten"] = "00";
k["eleven"] = "21";
k["twelve"] = "44";
k["thirteen"] = "69";
k["fourteen"] = "196";
k["fifteen"] = "25";
k["sixteen"] = "56";
k["seventeen"] = "89";
k["eighteen"] = "24";
k["nineteen"] = "61";
k["twenty"] = "00";
k["a"] = "01";
k["both"] = "04";
k["another"] = "01";
k["first"] = "01";
k["second"] = "04";
k["third"] = "09";
string tx;
int cou = 1;
for( i = 1; i <= 6; i++)
{
cin>>tx;
for(j = 0; j < tx.size(); j++){
if(t[j] >= 'A' && tx[j] <= 'Z') tx[j] =tx[j]-'A' + 'a';
if(t[j] == '.') tx.erase(j);
}
if(num[cou]=k[tx])
{
cou++;
}
}
if(!cou){
cout<<"0";
return 0;
}
sort(num+1, num+cou+1, cmp);
i=1;
while(i<cou)
{
t+=num[i];
i++;
}
i=0;
while(t[i]=='0')
{
i++;
}
for(j=i;j<=t.size();j++)
cout<<t[j];
return 0;
}