酸酸Charles @ 2019-02-18 22:44:12
using namespace std;
vector<int>v;
map<string,int>m;
char a[15];
int main(){
vector<int>::iterator it;
m["one"]=1,m["two"]=4,m["three"]=9,m["four"]=16;m["five"]=25;
m["six"]=36,m["seven"]=49,m["eight"]=64,m["nine"]=81,m["ten"]=0;
m["eleven"]=21,m["twelve"]=44,m["thirteen"]=69,m["fourteen"]=96,m["fifteen"]=25;
m["sixteen"]=56,m["seventeen"]=89,m["eighteen"]=24,m["ninteen"]=61,m["twenty"]=0;
m["a"]=1,m["both"]=4,m["another"]=1,m["first"]=1,m["second"]=4,m["third"]=9;
string s,s1;
for(int i=0;i<6;i++){
cin>>s;
if(i==5)
s1=s.substr(0,s.length()-1);
else s1=s.substr();
if(m[s1]>0&&m[s1]<100){
v.push_back(m[s1]);
}
}
if(v.empty())
cout<<0<<endl;
else {
sort(v.begin(),v.end());
if((*v.begin())==0){
for(it=v.begin();it!=v.end();it++){
if((*it)!=0){
cout<<(*it);
v.erase(it);
break;
}
}
}
for(it=v.begin();it!=v.end();it++){
if(it!=v.begin()&&((*it)>=0&&(*it)<=9))
cout<<0;
cout<<(*it);
}
}
}