当前位置:网站首页>4276. 擅长C
4276. 擅长C
2022-07-27 08:37:00 【追寻远方的人】
当你被面试官要求用 CC 写一个 Hello World 时,有本事像下图显示的那样写一个出来吗?

输入格式
输入首先给出 26 个英文大写字母 A−Z,每个字母用一个 7×5 的、由 C 和 . 组成的矩阵构成。
最后在一行中给出一个句子,以回车结束。句子是由若干个单词(每个包含不超过 10 个连续的大写英文字母)组成的,单词间以任何非大写英文字母分隔。
题目保证至少给出一个单词。
输出格式
对每个单词,将其每个字母用矩阵形式在一行中输出,字母间有一列空格分隔。单词的首尾不得有多余空格。
相邻的两个单词间必须有一空行分隔。输出的首尾不得有多余空行。
数据范围
最后一行句子的总长度范围 [1,5000][1,5000],
给出的单词数量范围 [1,300][1,300]。
输入样例:
..C..
.C.C.
C...C
CCCCC
C...C
C...C
C...C
CCCC.
C...C
C...C
CCCC.
C...C
C...C
CCCC.
.CCC.
C...C
C....
C....
C....
C...C
.CCC.
CCCC.
C...C
C...C
C...C
C...C
C...C
CCCC.
CCCCC
C....
C....
CCCC.
C....
C....
CCCCC
CCCCC
C....
C....
CCCC.
C....
C....
C....
CCCC.
C...C
C....
C.CCC
C...C
C...C
CCCC.
C...C
C...C
C...C
CCCCC
C...C
C...C
C...C
CCCCC
..C..
..C..
..C..
..C..
..C..
CCCCC
CCCCC
....C
....C
....C
....C
C...C
.CCC.
C...C
C..C.
C.C..
CC...
C.C..
C..C.
C...C
C....
C....
C....
C....
C....
C....
CCCCC
C...C
C...C
CC.CC
C.C.C
C...C
C...C
C...C
C...C
C...C
CC..C
C.C.C
C..CC
C...C
C...C
.CCC.
C...C
C...C
C...C
C...C
C...C
.CCC.
CCCC.
C...C
C...C
CCCC.
C....
C....
C....
.CCC.
C...C
C...C
C...C
C.C.C
C..CC
.CCC.
CCCC.
C...C
CCCC.
CC...
C.C..
C..C.
C...C
.CCC.
C...C
C....
.CCC.
....C
C...C
.CCC.
CCCCC
..C..
..C..
..C..
..C..
..C..
..C..
C...C
C...C
C...C
C...C
C...C
C...C
.CCC.
C...C
C...C
C...C
C...C
C...C
.C.C.
..C..
C...C
C...C
C...C
C.C.C
CC.CC
C...C
C...C
C...C
C...C
.C.C.
..C..
.C.C.
C...C
C...C
C...C
C...C
.C.C.
..C..
..C..
..C..
..C..
CCCCC
....C
...C.
..C..
.C...
C....
CCCCC
HELLO~WORLD!
输出样例:
C...C CCCCC C.... C.... .CCC.
C...C C.... C.... C.... C...C
C...C C.... C.... C.... C...C
CCCCC CCCC. C.... C.... C...C
C...C C.... C.... C.... C...C
C...C C.... C.... C.... C...C
C...C CCCCC CCCCC CCCCC .CCC.
C...C .CCC. CCCC. C.... CCCC.
C...C C...C C...C C.... C...C
C...C C...C CCCC. C.... C...C
C.C.C C...C CC... C.... C...C
CC.CC C...C C.C.. C.... C...C
C...C C...C C..C. C.... C...C
C...C .CCC. C...C CCCCC CCCC.
代码:
// 模拟
#include <bits/stdc++.h>
using namespace std;
char g[26][7][6];
bool is_first = true;
void output(string word)
{
if (word.empty())
return;
if (is_first)
is_first = false;
else
cout << endl;
char str[7][60] = {
0};
for (int i = 0; i < word.size(); i++)
{
for (int j = 0; j < 7; j++)
{
for (int k = 0; k < 5; k++)
str[j][i * 6 + k] = g[word[i] - 'A'][j][k];
}
}
for (int i = 1; i < word.size(); i++)
{
for (int j = 0; j < 7; j++)
str[j][i * 6 - 1] = ' ';
}
for (int i = 0; i < 7; i++)
cout << str[i] << endl;
}
int main()
{
for (int i = 0; i < 26; i++)
{
for (int j = 0; j < 7; j++)
cin >> g[i][j];
}
string word;
char c;
while ((c = getchar()) != -1)
{
if (c >= 'A' && c <= 'Z')
word += c;
else
{
output(word);
word = "";
}
}
output(word);
return 0;
}
边栏推荐
- Risk control and application of informatization project
- Help send some recruitment. If you are interested, you can have a look
- 03.使用引号来监听对象嵌套值的变化
- Openresty + keepalived 实现负载均衡 + IPV6 验证
- QPushButton 按钮的创建与简单应用
- Initial summary of flask framework creation project
- 1176 questions of Olympiad in informatics -- who ranked K in the exam
- All in one 1353 -- expression bracket matching (stack)
- Realization of background channel group management function
- Realize SKU management in the background
猜你喜欢

Flask project configuration

Minio 安装与使用

Solution to the program design of the sequence structure of one book (Chapter 1)
![[MRCTF2020]Ezpop 1](/img/c0/41873fe5864490ade403eeddc26976.png)
[MRCTF2020]Ezpop 1

redis的string类型及bitmap

Block, there is a gap between the block elements in the row
![[NPUCTF2020]ReadlezPHP 1](/img/d9/590446b45f917be3f077a9ea739c20.png)
[NPUCTF2020]ReadlezPHP 1

Create a project to realize login and registration, generate JWT, and send verification code

Chapter 2 foreground data display

Include error in vs Code (new header file)
随机推荐
P7 Day1 get to know the flask framework
General view, DRF view review
Oppo self-developed large-scale knowledge map and its application in digital intelligence engineering
openGauss之TryMe初体验
Include error in vs Code (new header file)
Flutter 渲染机制——GPU线程渲染
MCDF顶层验证方案
[penetration test tool sharing] [dnslog server building guidance]
How to uninstall -- Qianxin secure terminal management system
Management of product pictures
Day5 - Flame restful request response and Sqlalchemy Foundation
All in one 1353 -- expression bracket matching (stack)
CMD command and NPM command
On Valentine's day, I drew an object with characters!
Using ecological power, opengauss breaks through the performance bottleneck
UVM入门实验1
How to permanently set source
Flink1.15源码阅读flink-clients客户端执行流程(阅读较枯燥)
我用字符画出了一个谷爱凌!
Luogu super Mary game