https://www.luogu.org/problem/P1603

#include<bits/stdc++.h>
using namespace std;
struct s {
string n;
string t;
} pass[]= {
{"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",""}
};
string searchs( string s) {
for(int i=; i<; i++) {
if(s==pass[i].n) {
return pass[i].t;//在列表中查找是否存在,不存在返回00
}
}
return "";
}
int main() {
bool output=false; //专为第三点设置
string str;
string x[];
for(int i=; i<; i++) {
cin>>str;
x[i]=searchs(str);
}
sort(x,x+);//利用string字典序的特性即可升序排序
bool flag=false;//判断从哪里要开始输出0,什么时候不要输出0
for(int i=; i<; i++) {
if(x[i]=="")
continue;
if(x[i][]==''&&flag==false) { //在最小数字判断第一位是否为0,如果是0,就直接输出第二位
flag=true; //标记 在以后遇到的数字都直接输出
} else cout<<x[i][];
cout<<x[i][];
output=true;
}
if(!output)cout<<"";//整个过程中都没有输出最后补一个0
}

最新文章

  1. 数据仓库之启用cdc
  2. iOS----关于第三方的运用(有待补充)
  3. 【HDU】4089 Activation
  4. NOIP(提高组)DAY1国王游戏
  5. 给eclipse配置sublime主题的背景
  6. linux 树型显示文件 tree ls tree 命令
  7. Python+ Selenium自动化登录腾讯QQ邮箱实例
  8. 迎战大数据-Oracle篇
  9. C# Redis 过期机制不生效问题
  10. C#获取应用程序路径
  11. Composer更新慢的解决方案
  12. Unity3D在移动平台下加载AssetBundle导致Shader效果不正确的问题
  13. SQL Server 磁盘请求超时的833错误原因分析以及解决
  14. CCNA实验3.单臂路由器
  15. Java调用Lua脚本(热载实现)
  16. nvm use 指定版本后无效 win7
  17. SHU 414 - 字符串进制转换
  18. (匹配)Antenna Placement --POJ --3020
  19. mongodb,redis,mysql的区别和具体应用场景
  20. Windows隐藏账户

热门文章

  1. Kubernetes CI/CD(1)
  2. 【Mac电脑新手技巧】苹果电脑如何更换用户头像?
  3. JMeter接口测试-跨线程组取参数值的两种方法
  4. 如何开发自己的第一个 Serverless Component
  5. TChart-数据编辑(TChartListBox,TeeCommander)
  6. 轻量级RPC设计与实现第二版
  7. ADB之安装APK
  8. sql注入文件写入和读取
  9. ActiveMQ的JMS消息可靠机制
  10. elasticsearch 5.5 query 过程 源码分析