ACtheQ @ 2023-06-20 21:55:39
%%%
#include <bits/stdc++.h>
using namespace std;
string number[30]={"-1","zero","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"};
int value[30]={-1,0,1,4,9,16,25,36,49,64,81,0,21,44,69,96,25,56,89,24,61,0,1,4,1,1,4,9};
int num[10];
int main()
{
for(int i=1;i<=6;i++)
{
string s;
cin>>s;
for(int i=1;i<=25;i++)
{
if(s==number[i]) num[i]=value[i];
}
}
sort(num+1,num+7);
bool flag=false;
for(int i=1;i<=6;i++)
{
if(num[i]==0) continue;
if(flag) printf("%.2d",num[i]);
else
{
cout<<num[i];
flag=true;
}
}
if(!flag) cout<<0;
return 0;
}
by Liyiyang1123 @ 2023-06-20 22:17:45
注意看这句:
(2)将这些数字平方后对
如果输入为
以你的程序输出