_ChongYun_ @ 2023-10-10 21:22:31
#include<bits/stdc++.h>
#define int long long
using namespace std;
struct node{
int val;
string st;
}a[1111];
int cnt=0;
int di[30]={0,1,4,9,16,25,36,49,64,81,00,21,44,69,96,25,56,89,24,61,0,1,4,1,1,4,9};
string str[50]={"","one","two","three","four","five","six","seven","eight","nine","ten","eleven","twelve","thirteen","fourteen","fifteen","sixteen","seventeen","eighteen","nineteen","twenty"};
bool cmp(node a,node b){
return a.val<b.val;
}
signed main(){
string s;
for(int i=1;i<=6;i++){
cin>>s;
int ki=0;
for(int j=1;j<=20;j++){
if(s==str[j]){
ki=j;
break;
}
}
if(s=="another") ki=1;
if(s=="first") ki=1;
if(s=="second") ki=2;
if(s=="third") ki=3;
if(ki){
a[++cnt].val=di[ki];
a[cnt].st=to_string(di[ki]);
if(a[cnt].st.size()==1) a[cnt].st='0'+a[cnt].st;
}
}
sort(a+1,a+cnt+1,cmp);
for(int i=0;i<a[1].st.size();i++){
if(a[1].st[i]!='0'){
break;
}else{
a[1].st=a[1].st.substr(1);
}
}
for(int i=1;i<=cnt;i++) cout<<a[i].st;
}
by huanyizhiyuan @ 2023-10-13 13:50:47
其他的暂且不论,请问你的zero a both这些单词在哪里?这难道不需要判断了么?