StarryFuture @ 2019-08-27 16:37:10
#include<iostream>
#include<cstdio>
#include<cstring>
#include<string>
#include<algorithm>
using namespace std;
int num[13],c,l,n;
void numm(int x);
int main()
{
string a;
while(1)
{
scanf("%s",&a);
if(a==".")break;
if(a=="one"){numm(1);continue;}
if(a=="two") {numm(2);continue;}
if(a=="three") {numm(3);continue;}
if(a=="four"){numm(4);continue;}
if(a=="five") {numm(5);continue;}
if(a=="six") {numm(6);continue;}
if(a=="seven") {numm(7);continue;}
if(a=="eight") {numm(8);continue;}
if(a=="nine") {numm(9);continue;}
if(a=="ten") {numm(10);continue;}
if(a=="eleven") {numm(11);continue;}
if(a=="twelve"){numm(12);continue;}
if(a=="thirteen") {numm(13);continue;}
if(a=="fourteen") {numm(14);continue;}
if(a=="fifteen") {numm(15);continue;}
if(a=="sixteen") {numm(16);continue;}
if(a=="seventeen") {numm(17);continue;}
if(a=="eighteen") {numm(18);continue;}
if(a=="nineteen") {numm(19);continue;}
if(a=="twenty") {numm(20);continue;}
if(a=="a") {numm(1);continue;}
if(a=="both") {numm(2);continue;}
if(a=="another") {numm(1);continue;}
if(a=="first") {numm(1);continue;}
if(a=="second") {numm(2);continue;}
if(a=="third") {numm(3);continue;}
}
int sum=c;
sort(num+1,num+sum+1);
/*for(int i=1;i<=12;i++)
n=n*10+num[i];*/
cout<<n;
return 0;
}
void numm(int x)
{
x=x*x%100;
if(x<10)
num[++c]=0;
while(x)
{
num[++c]=x%10;
x/=10;
}
}
by HAO233 @ 2019-08-27 16:53:05
令人窒息的复杂度.jpg
by Hexarhy @ 2019-08-27 17:27:16
楼上正解。
by StarryFuture @ 2019-08-28 14:28:29
@HAO233 复杂度不高吧