当前位置:网站首页>擅长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;
}
边栏推荐
- Analyzing the curriculum design evaluation system of steam Education
- Compiled by egg serialize TS
- 快恢复二极管工作原理及使用
- Ffmpeg video coding
- Yapi installation
- 再获认可 | 赛宁网安连续上榜《CCSIP 2022中国网络安全产业全景图》
- What if win11 cannot wake up from sleep? Solution of win11 unable to wake up during sleep
- 二、国际知名项目-HelloWorld
- FFmpeg 视频编码
- Postman 导入curl 、导出成curl、导出成对应语言代码
猜你喜欢

"Game engine light in light out" 4. shader

Optimization analysis and efficiency execution of MySQL

Kubernetes advanced training camp scheduler

Chapter 3 how to use sourcetree to submit code

SQL加解密注入详解

Spark Structured Streaming HelloWorld

Yapi installation
![[semantic segmentation] 2018-deeplabv3+ ECCV](/img/c9/d1e2d7e63df8db2a7fa2bde31b10f7.png)
[semantic segmentation] 2018-deeplabv3+ ECCV

UE4 键盘控制开关灯

egg-ts-sequelize-CLI
随机推荐
clock_ gettime
Array sort 3
MySQL usage
五、域对象共享数据
Tutorial on using the one click upgrade function of the rtsp/onvif protocol video platform easynvr service
再获认可 | 赛宁网安连续上榜《CCSIP 2022中国网络安全产业全景图》
[uoj 429] runs (inclusive) + a little record about Lyndon tree and its application
【语义分割】2018-DeeplabV3+ ECCV
Li Kou daily question - day 42 -661. Picture smoother
3、 @requestmapping annotation
Is this my vs not connected to the database
Comparison of the relationship between the number of partitions and the number of reducetask in MapReduce
Use of anonymous functions
Spark Structured Streaming HelloWorld
第三篇如何使用SourceTree提交代码
11、 Exception handler
【UOJ 429】串串划分(Runs)(容斥)+ 有关 Lyndon Tree 及其应用的小小记录
Yuansaka Lin wallpaper
常函数const的学习
Codeforces Round #807 (Div. 2)