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 ...
随机推荐
- Servlet--HttpServletResponse的2个操作流的方法
前面已经说过无数多次了,我们的项目都是基于HTTP协议的一次请求,一次响应.实际编码中,我们在处理完逻辑后一般是跳转到一个页面上,或者用输出流返回json字符串.其实跳转到一个页面往往也就是JSP,J ...
- git 安装使用
系统ubuntu14.04 1.安装:sudo apt-get install git 2.设置name and Email: git config --global user.name " ...
- Hive环境搭建
hive 环境搭建需要hadoop的环境.hadoop环境的搭建不在这里赘述.参考:http://www.cnblogs.com/parkin/p/6952370.html 1.准备阶段 hive 官 ...
- 关于int main( int argc, char *argv[] )
int main(int argc, char *argv[], char *env[]) 1. int argc 表示你在命令行下输入命令的时候,一共有多少个参数. 2. char *argv[] ...
- 文字滚动效果,jquery和marquee标签
链接:https://pan.baidu.com/s/1pMwHYH1 密码:r9ys marquee标签是微软创建的,后来大部分浏览器都适用后,微软在IE8把这个标签去掉了.为符合W3C规范,还是使 ...
- libGDX-wiki发布
为方便大家学习和访问,我将libgdx的wiki爬取到doku-wiki下,专门建立了以下地址.欢迎大家来共同完善. http://wiki.v5ent.com
- BZOJ 1998: [Hnoi2010]Fsk物品调度 [置换群 并查集]
传送门 流水线上有n个位置,从0到n-1依次编号,一开始0号位置空,其它的位置i上有编号为i的盒子.Lostmonkey要按照以下规则重新排列这些盒子. 规则由5个数描述,q,p,m,d,s,s表示空 ...
- BZOJ 3670: [Noi2014]动物园 [KMP]
求这玩意: 对于字符串S的前i个字符构成的子串,既是它的后缀同时又是它的前缀,并且该后缀与该前缀不重叠,将这种字符串的数量记作num[i] 对1,000,000,007取模的结果 n≤5,L≤1,00 ...
- AWS-SS配置过程
为满足家长要求,以下只录步骤: 远端: 1. 注册并启动一个AWS实例.这一步网上N多教程,搜 AWS EC2 等均可. 2. 远程安装SS,并写配置文件.依然网搜, AWS S(hadow)S(oc ...
- H5动画
1.参考:http://blog.csdn.net/whqet/article/details/42911059?readlog https://developer.mozilla.org/zh-CN ...