The Cow-Signal
来源:互联网 发布:office软件安装失败 编辑:程序博客网 时间:2024/05/17 06:06
【Description】
Bessie and her cow friends are playing as their favorite cow superheroes. Of course, everyone knows that any self-respecting superhero needs a signal to call them to action. Bessie has drawn a special signal on a sheet of M×N paper (1≤M≤10,1≤N≤10), but this is too small, much too small! Bessie wants to amplify the signal so it is exactly K times bigger (1≤K≤10) in each direction.
The signal will consist only of the ‘.’ and ‘X’ characters.
【Input】
The first line of input contains M, N, and K, separated by spaces.
The next M lines each contain a length-N string, collectively describing the picture of the signal.
【Output】
You should output KM lines, each with KN characters, giving a picture of the enlarged signal.
【Sample Input】
5 4 2
XXX.
X..X
XXX.
X..X
XXX.
【Sample Output】
XXXXXX..
XXXXXX..
XX….XX
XX….XX
XXXXXX..
XXXXXX..
XX….XX
XX….XX
XXXXXX..
XXXXXX..
【题意简述】
给出一个N*M的由X和.组成的图片,将其放大至原来的K倍。
【分析】
从数据范围就可以看出是模拟。
#include<string>#include<iostream>#include<cstdio>using namespace std;int main(){ int n,m,t; char a[20][20],b[200]; scanf("%d%d%d",&n,&m,&t); for (int i=0;i<n;i++) cin>>a[i]; for (int i=0;i<n;i++){ for (int j=0;j<200;j++) b[j]='!'; for (int j=0;j<m;j++){ b[j*t]=a[i][j]; for (int k=1;k<t;k++) b[j*t+k]=b[j*t]; } for (int j=0;j<t;j++){ for (int k=0;k<m*t;k++) cout<<b[k]; cout<<endl; } }}
- The Cow-Signal
- The Unix Signal
- POJ3267 The Cow Lexicon
- 3267 The Cow Lexicon
- The Cow Lexicon
- The nearest taller cow
- 重做catch the cow
- Catch The Cow
- catch the cow (P3278)
- POJ3267--The Cow Lexicon
- UVa10678 - The Grazing Cow
- poj3267 The Cow Lexicon
- HLG Catch The Cow
- BFS_catch the cow
- POJ3276---The Cow Lexicon
- The Cow Lexicon
- The Cow Lexicon(POJ_3267)
- poj3267 The Cow Lexicon
- objc.io 2.1 Concurrent Programming: APIs and Challenges (转)
- Oracle数据库学习4之查询语句
- 模板方法模式(TemplateMethod)
- const、typedef和volatile
- win7/centos7搭建relk日志管理系统
- The Cow-Signal
- Eclipse快捷键大全
- tiny4412 SDK1312B LED驱动
- .net mvc利用NPOI导入导出excel
- objc.io 2.2 Common Background Practices(转)
- URI 、URL、URN 简单理解
- Xcode之修改模板
- AF_UNSPEC
- Oracle数据库学习5之查询进阶:连接查询