NJU 1010 Air
思路:把那张图打表(吐血...),然后就按照规则输出就行。
AC代码
#include <cstdio> #include <cmath> #include <cctype> #include <algorithm> #include <cstring> #include <utility> #include <string> #include <iostream> #include <map> #include <set> #include <vector> #include <queue> #include <stack> using namespace std; #pragma comment(linker, "/STACK:1024000000,1024000000") #define eps 1e-10 #define inf 0x3f3f3f3f #define PI pair<int, int> typedef long long LL; const int maxn = 50 + 5; string a[maxn]; void init() { for(int i = 0; i <= 35; ++i) { if(i == 0) a[i] = ".-"; else if(i == 1) a[i] = "-..."; else if(i == 2) a[i] = "-.-."; else if(i == 3) a[i] = "-.."; else if(i == 4) a[i] = "."; else if(i == 5) a[i] = "..-."; else if(i == 6) a[i] = "--."; else if(i == 7) a[i] = "...."; else if(i == 8) a[i] = ".."; else if(i == 9) a[i] = ".---"; else if(i == 10) a[i] = "-.-"; else if(i == 11) a[i] = ".-.."; else if(i == 12) a[i] = "--"; else if(i == 13) a[i] = "-."; else if(i == 14) a[i] = "---"; else if(i == 15) a[i] = ".--."; else if(i == 16) a[i] = "--.-"; else if(i == 17) a[i] = ".-."; else if(i == 18) a[i] = "..."; else if(i == 19) a[i] = "-"; else if(i == 20) a[i] = "..-"; else if(i == 21) a[i] = "...-"; else if(i == 22) a[i] = ".--"; else if(i == 23) a[i] = "-..-"; else if(i == 24) a[i] = "-.--"; else if(i == 25) a[i] = "--.."; else if(i == 26) a[i] = "-----"; else if(i == 27) a[i] = ".----"; else if(i == 28) a[i] = "..---"; else if(i == 29) a[i] = "...--"; else if(i == 30) a[i] = "....-"; else if(i == 31) a[i] = "....."; else if(i == 32) a[i] = "-...."; else if(i == 33) a[i] = "--..."; else if(i == 34) a[i] = "---.."; else if(i == 35) a[i] = "----."; } for(int i = 0; i <= 35; ++i) { string s = a[i]; a[i].clear(); for(int j = 0; j < s.size(); ++j) { if(s[j] == '.') a[i].push_back('='); else for(int k = 0; k < 3; ++k) a[i].push_back('='); if(j < s.size()-1) a[i].push_back('.'); } } } int main() { init(); int T, n, kase = 1; char s[25]; scanf("%d", &T); while(T--) { printf("Case #%d: ", kase++); scanf("%d", &n); for(int i = 0; i < n; ++i) { scanf("%s", s); for(int j = 0; j < strlen(s); ++j) { s[j] = toupper(s[j]); if(s[j] >= 'A' && s[j] <= 'Z') { cout << a[s[j]-'A']; } else cout << a[s[j]-'0'+26]; if(j != strlen(s)-1) printf("..."); } if(i != n-1) printf("......."); } printf("\n"); } return 0; }
如有不当之处欢迎指出!
NJU 1010 Air的更多相关文章
- poj——1422 Air Raid
Air Raid Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 8577 Accepted: 5127 Descript ...
- HDU 4756 Install Air Conditioning(次小生成树)
题目大意:给你n个点然后让你求出去掉一条边之后所形成的最小生成树. 比較基础的次小生成树吧. ..先prime一遍求出最小生成树.在dfs求出次小生成树. Install Air Conditioni ...
- BZOJ 1010: [HNOI2008]玩具装箱toy [DP 斜率优化]
1010: [HNOI2008]玩具装箱toy Time Limit: 1 Sec Memory Limit: 162 MBSubmit: 9812 Solved: 3978[Submit][St ...
- Entity Framework 6 Recipes 2nd Edition(10-10)译 - > 为TPH继承的插入、更新、删除操作映射到存储过程
10-10. 为TPH继承的插入.更新.删除操作映射到存储过程 问题 TPH继承模型,想把它的插入.修改.删除操作映射到存储过程 Solution 假设数据库有一个描述不同种类的产品表(Product ...
- ERROR 1010 (HY000): Error dropping database (can't rmdir './test/', errno: 17)
在删除数据库的时候报标题所示错误 mysql> drop database test; ERROR (HY000): Error dropping database (can't rmdir ' ...
- 解决adobe air sdk打包 apk后自动在包名前面加上air. (有个点)前缀的问题
早就找到了这个方法,但是一直忙没心思写博客. 默认情况下,所有 AIR Android 应用程序的包名称都带 air 前缀.若不想使用此默认行为,可将计算机环境变量 AIR_NOANDROIDFLAI ...
- adobe air类app 接入腾讯开放平台移动游戏使用带tencent包名前缀的问题
作者:Panda Fang 出处:http://www.cnblogs.com/lonkiss/p/4209159.html 原创文章,转载请注明作者和出处,未经允许不可用于商业营利活动 ------ ...
- Adobe AIR 中为不同尺寸和分辨率屏幕适配
在 Adobe AIR 中为不同屏幕尺寸的多种设备提供支持 http://www.adobe.com/cn/devnet/air/articles/multiple-screen-sizes.html ...
- Ural 1010. Discrete Function
1010. Discrete Function Time limit: 1.0 secondMemory limit: 64 MB There is a discrete function. It i ...
随机推荐
- jsp页面遍历List<Array>
不难的遍历,难住了“前辈”,因此决定分享一下希望帮助那些还迷糊的人. 数据结构下如图所示,之前的前辈遍历方法如下,厉害哦!当然,代码直接抛异常哈, <c:if test="${!emp ...
- The POM for * is invalid
The POM for yanan:jar:1.0-SNAPSHOT is invalid, transitive dependencies (if any) will not be availabl ...
- Long转Date/页面自定义标签
运行时发现异常:org.apache.jasper.JasperException: javax.el.ELException: java.lang.IllegalArgumentException: ...
- Python 中if的使用
reference : https://docs.python.org/3/reference/expressions.html#conditional-expressions 6.11. Cond ...
- 【转】高精度GPS测量中框架基准的统一
一.地面基准点的坐标基准转换 一般情况下,我们可以从IERS或IGS等机构获取最新的站坐标和速度场,这些站坐标和速度场是在某一特定基准框架和历元下的坐标值,若要提供高精度GPS网的分析使用,还需要作框 ...
- MySQL相关命令与备份
不加任何参数直接备份 mysqldump -uroot zabbix >/opt/zabbix.bak.sql 恢复,这样恢复时需要自已创建表 mysql -uroot < zabbix. ...
- 2018-02-02-解决IDE中无法忽略的非代码文件
layout: post title: 2018-02-02-解决IDE中无法忽略的非代码文件 key: 20180202 tags: GIT 版本管理 modify_date: 2018-02-02 ...
- cmd中控制某个命令执行多少次
for /l %i in (1,1,5) do calc五次启动计算器程序for /l %i in (start ,step,end) do commandfor /l 表示从数字start开始,以s ...
- iOS-电子书开发 笔记
前言 刚接手电子书项目时,和安卓开发者pt Cai老师[aipiti Cai,一个我很敬佩很资深的开发工程师,设计领域:c++.Java.安卓.QT等]共同商议了一下,因为项目要做要同步,移动端[手机 ...
- CDlinux制作U盘启动盘,打造自己的口袋系统
工具: 1.8G或以上U盘一枚: 2.CDlinux0.9.7.1镜像文件,注意其他版本不一定能成功(传送门http://pan.baidu.com/s/1o7P6Gu2): 3.UltraISO或U ...