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 ...
随机推荐
- CSS深入理解学习笔记之overflow
1.Overflow基本属性 overflow:visible(默认)/hidden/scroll/auto/inherit; visible:超出部分可见. hidden:超出部分隐藏. scrol ...
- .Net Core部署到CentOS
本文基于初次或再次尝试部署.Net Core应用到Linux服务器上,我尝试后自我总结的经验一个简单的Demo,尝试部署在Linux服务器上和跨服务器访问数据库. 一.环境介绍 1.本地使用Visua ...
- 童攀TP5企业网站实战笔记
$this->assign('data',$data) ---恢复内容开始--- return view(); 载入视图 {include file='public/head'} 包含文件 ...
- 在nagios中使用nrpe自定义脚本
nrpe的安装 tar xvfz nrpe-2.13.tar.gz cd nrpe-2.13 ./configure make all make install-plugin make inst ...
- 关于scanf,gets
1.用了gets后,假如你没有输入任何东西直接[enter],它将执行下一条命令 2.用了scanf后,直接按了[enter],它将换行并等待你的输入,直到你输入非[enter],再执行下一条命令. ...
- 00_Python面试题_迭代更新
一.Python是什么类型的语言,以及和其他语言对比 1.Python是一种解释性语言,他和C语言以及C衍生的语言不通,在Python运行之前不需要编译,其他解释语言还有Ruby.PHP. 2.Pyt ...
- Java设计模式之策略模式与状态模式
版权声明:本文出自汪磊的博客,转载请务必注明出处. 一.策略模式定义 定义:策略模式定义了一系列的算法,并将每一个算法封装起来,而且使他们之间可以相互替换,策略模式可以在不影响客户端的情况下发生变化. ...
- 跟我一起读postgresql源码(十六)——Executor(查询执行模块之——control节点(下))
5.ModifyTable节点 先看一个ModifyTable节点的例子: postgres=# explain update test_01 set id = 5 where name = 'xxx ...
- java重定向
package com.sn.servlet; import java.io.IOException; import javax.servlet.ServletException; import ja ...
- 2017年总结的前端文章——一劳永逸的搞定 flex 布局
flex 基本概念 使用 flex 布局首先要设置父容器 display: flex,然后再设置 justify-content: center 实现水平居中,最后设置 align-items: ce ...