int树先生 @ 2020-01-14 22:50:04
#include<iostream>
using namespace std;
string a;
int flag[7];
const string d[]={"OO","one.","two.","three.","four.","five.","six.","sven.","eight.","nine.","ten.","eleven.","twelve.","thirteen.","fourteen.","fifteen.","sixteen.","seventeen.","eighteen.","nineteen.","twenty."};
const string c[]={"OO","One","Two","Three","Four","Five","Six","Sven","Eight","Nine","Ten","Eleven","Twelve","Thirteen","Fourteen","Fifteen","Sixteen","Seventeen","Eighteen","Nineteen","Twenty"};
const string b[]={"OO","one","two","three","four","five","six","sven","eight","nine","ten","eleven","twelve","thirteen","fourteen","fifteen","sixteen","seventeen","eighteen","nineteen","twenty"};
void fout(int ff){
for(int k=1;k<=ff;k++){
int minn;int wei;
for(int i=1;i<=6;i++){
if(flag[i]){
if(flag[i]<minn){
minn=flag[i];
wei=i;
}
}
}
cout<<minn;minn=0;
flag[wei]=0;
}
return;
}
int main()
{
int ff=0;
for(int i=1;i<=6;i++){
cin>>a;
for(int k=1;k<=20;k++){
if(a==c[k]||a==b[k]){
flag[i]=(k*k)%100;
ff++;
}
}
}
if(!ff)cout<<"0";
else {
fout(ff);
}
return 0;
}
by int树先生 @ 2020-01-14 22:51:28
if(a==c[k]||a==b[k]||a==d[k])
上改成这个
by Retired_lvmao @ 2020-01-15 08:24:02
a both 这些都是数字
by Retired_lvmao @ 2020-01-15 08:24:22
还有你的 seven 打错了