当前位置:网站首页>擅长C(暑假每日一题 6)
擅长C(暑假每日一题 6)
2022-07-26 04:38:00 【sweetheart7-7】
当你被面试官要求用 C C C 写一个 Hello World 时,有本事像下图显示的那样写一个出来吗?

输入格式
输入首先给出 26 26 26 个英文大写字母 A − Z A−Z A−Z,每个字母用一个 7 × 5 7×5 7×5 的、由 C 和 . 组成的矩阵构成。
最后在一行中给出一个句子,以回车结束。句子是由若干个单词(每个包含不超过 10 10 10 个连续的大写英文字母)组成的,单词间以任何非大写英文字母分隔。
题目保证至少给出一个单词。
输出格式
对每个单词,将其每个字母用矩阵形式在一行中输出,字母间有一列空格分隔。单词的首尾不得有多余空格。
相邻的两个单词间必须有一空行分隔。输出的首尾不得有多余空行。
数据范围
最后一行句子的总长度范围 [ 1 , 5000 ] [1,5000] [1,5000],
给出的单词数量范围 [ 1 , 300 ] [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<iostream>
#include<vector>
using namespace std;
char str[30][10][10];
void split(string & s, vector<string> &v){
for(int i = 0, j = 0; i < s.size(); i++)
if('A' <= s[i] && s[i] <= 'Z'){
j = i + 1;
while(j < s.size() && 'A' <= s[j] && s[j] <= 'Z') j++;
v.push_back(s.substr(i, j - i));
i = j - 1;
}
}
void print(string & s){
for(int i = 0; i < 7; i++){
for(int j = 0; j < s.size(); j++){
for(int k = 0; k < 5; k++)
cout << str[s[j]-'A'][i][k];
if(j != s.size() - 1) cout << ' ';
}
cout << '\n';
}
}
int main(){
for(int i = 0; i < 26; i++)
for(int j = 0; j < 7; j++)
scanf("%s", str[i][j]);
string s;
getchar();
getline(cin, s);
vector<string> v;
split(s, v);
print(v[0]);
for(int i = 1; i < v.size(); i++){
puts("");
print(v[i]);
}
return 0;
}
边栏推荐
- Bsdiff and bspatch incremental updates
- The auxiliary role of rational cognitive educational robot in teaching and entertainment
- MapReduce中分区数与ReduceTask个数关系比较
- egg-ts-sequelize-CLI
- Use of anonymous functions
- 青少年创客教育的创意设计原理
- 十一、异常处理器
- 二、国际知名项目-HelloWorld
- 2022河南萌新联赛第(三)场:河南大学 L - 合成游戏
- [semantic segmentation] 2018-deeplabv3+ ECCV
猜你喜欢

Yapi installation

Kubernetes 进阶训练营 调度器

二、国际知名项目-HelloWorld

FFmpeg 视频添加水印

UE4 displays text when it is close to the object, and disappears when it is far away

7、 Restful

Database startup message: ora-29702: error occurred in cluster group service

数组排序3

Kubernetes advanced training camp scheduler

解析Steam教育的课程设计测评体系
随机推荐
AWS Support Plan
Solve the error string value: '\xf0\x9f\x98\xad',... 'for column' commentcontent 'at row 1
数据仓库
Tutorial on using the one click upgrade function of the rtsp/onvif protocol video platform easynvr service
FFmpeg 视频添加水印
UE4 displays text when it is close to the object, and disappears when it is far away
Working principle and application of fast recovery diode
数据库连接数查看和修改
SQL加解密注入详解
[300 + selected interview questions from big companies continued to share] big data operation and maintenance sharp knife interview question column (VIII)
UE4 two ways to obtain player control
Array sort 1
常函数const的学习
Page pull-up refresh and pull-down loading
UE4 controls the rotation of objects by pressing keys
使用百度飞桨EasyDL完成垃圾分类
Array sort 2
Keil v5安装和使用
MySQL日志分类:错误日志、二进制日志、查询日志、慢查询日志
2022 Henan Mengxin League game (3): Henan University J - magic number