poj1102
模拟
#include <iostream>
#include <string>
using namespace std; char numbers[][][] = {
{
' ', '-', ' ',
'|', ' ', '|',
' ', ' ', ' ',
'|', ' ', '|',
' ', '-', ' ',
},
{
' ', ' ', ' ',
' ', ' ', '|',
' ', ' ', ' ',
' ', ' ', '|',
' ', ' ', ' ',
},
{
' ', '-', ' ',
' ', ' ', '|',
' ', '-', ' ',
'|', ' ', ' ',
' ', '-', ' ',
},
{
' ', '-', ' ',
' ', ' ', '|',
' ', '-', ' ',
' ', ' ', '|',
' ', '-', ' ',
},
{
' ', ' ', ' ',
'|', ' ', '|',
' ', '-', ' ',
' ', ' ', '|',
' ', ' ', ' ',
},
{
' ', '-', ' ',
'|', ' ', ' ',
' ', '-', ' ',
' ', ' ', '|',
' ', '-', ' ',
},
{
' ', '-', ' ',
'|', ' ', ' ',
' ', '-', ' ',
'|', ' ', '|',
' ', '-', ' ',
},
{
' ', '-', ' ',
' ', ' ', '|',
' ', ' ', ' ',
' ', ' ', '|',
' ', ' ', ' ',
},
{
' ', '-', ' ',
'|', ' ', '|',
' ', '-', ' ',
'|', ' ', '|',
' ', '-', ' ',
},
{
' ', '-', ' ',
'|', ' ', '|',
' ', '-', ' ',
' ', ' ', '|',
' ', '-', ' ',
}
};
int size; void print(int line, char *se)
{
int i, j; for (i = ; i < strlen(se); i++)
{
cout << numbers[se[i] - ''][line][];
for (j = ; j < size; j++)
cout << numbers[se[i] - ''][line][];
cout << numbers[se[i] - ''][line][];
cout << " ";
}
cout << endl;
} void work()
{
char se[];
int i; cin >> se;
print(, se);
for (i = ; i < size; i++)
print(, se);
print(, se);
for (i = ; i < size; i++)
print(, se);
print(, se);
cout << endl;
} int main()
{
//freopen("t.txt", "r", stdin);
while (cin >> size && size != )
work();
return ;
}
poj1102的更多相关文章
随机推荐
- [洛谷P3175][HAOI2015]按位或
题目大意:刚开始有一个数$x=0$,每秒钟有一个数$y\in[0,2^n)(n\leqslant20)$按一定概率随机出现,数$i$的概率为$p_i$,保证$\sum\limits_{i=0}^{2^ ...
- C++继承与组合的区别
C++程序开发中,设计孤立的类比较容易,设计相互关联的类却比较难,这其中会涉及到两个概念,一个是继承(Inheritance),一个是组合(Composition).因为二者有一定的相似性,往往令程序 ...
- EMF的安装及用例
转: EMF的安装及用例 本人正在开发专门针对计算机视觉领域的DSL(这是一个和某公司合作的项目),欢迎各位朋友一起交流学习! 一.简介 EMF是一个建模框架和代码生成工具,用于构建基于结构化数据模型 ...
- R安装时出现辑程包不存在,解决方法
R > -------------------------------------------------[解决方案]1.使用命令单独安装caret,安装的时间很长.install.packag ...
- python代码自动补全配置及Django入门Demo
django入门代码示例小博客:https://pan.baidu.com/s/1pLjLPSv 1.自动补全功能 许多人都知道 iPython 有很好的自动补全能力,但是就未必知道 python 也 ...
- R语言:克里金插值
基于空间自相关,R语言克里金插值 library(gstat) Warning message: In scan(file = file, what = what, sep = sep, quote ...
- python 类与对象解析
类成员: # 字段 - 普通字段,保存在对象中,执行只能通过对象访问 - 静态字段,保存在类中, 执行 可以通过对象访问 也可以通过类访问 # ...
- Hadoop生态圈-Hive的自定义函数之UDF(User-Defined-Function)
Hadoop生态圈-Hive的自定义函数之UDF(User-Defined-Function) 作者:尹正杰 版权声明:原创作品,谢绝转载!否则将追究法律责任.
- Calculus on Computational Graphs: Backpropagation
Calculus on Computational Graphs: Backpropagation Introduction Backpropagation is the key algorithm ...
- Java并发编程原理与实战五:创建线程的多种方式
一.继承Thread类 public class Demo1 extends Thread { public Demo1(String name) { super(name); } @Override ...