当前位置:网站首页>Good at C (summer vacation daily question 6)
Good at C (summer vacation daily question 6)
2022-07-26 04:39:00 【sweetheart7-7】
When you are asked by the interviewer to use C C C Write a Hello World when , Do you have the ability to write one out as shown in the figure below ?

Input format
The input first gives 26 26 26 English capital letters A − Z A−Z A−Z, One for each letter 7 × 5 7×5 7×5 Of 、 from C and . The matrix formed by .
Finally, give a sentence in one line , End with a carriage return . A sentence consists of several words ( Each contains no more than 10 10 10 Consecutive capital letters ) Composed of , Words are separated by any non capitalized English letter .
The title is guaranteed to give at least one word .
Output format
For each word , Output each letter in a row in matrix form , There is a column of spaces between the letters . There must be no extra spaces at the beginning and end of the word .
There must be a space between two adjacent words . There must be no extra blank lines at the beginning and end of the output .
Data range
The total length range of the last line of sentences [ 1 , 5000 ] [1,5000] [1,5000],
Given word number range [ 1 , 300 ] [1,300] [1,300].
sample input :
..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!
sample output :
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;
}
边栏推荐
- 旋转数组最小数字
- Solve the error string value: '\xf0\x9f\x98\xad',... 'for column' commentcontent 'at row 1
- What are the restrictions on opening futures accounts? Where is the safest place to open an account?
- Steam science education endows classroom teaching with creativity
- 十一、异常处理器
- 2022杭电多校第二场 A.Static Query on Tree(树剖)
- Several methods of realizing high-low byte or high-low word exchange in TIA botu s7-1200
- MySQL 执行失败的sql是否会计入慢查询?
- Add watermark to ffmpeg video
- 数组排序3
猜你喜欢

Threadpooltaskexecutor and ThreadPoolExecutor

青少年创客教育的创意设计原理

FFmpeg 视频编码

Customer service relationship management based on SQL net enterprise messenger enterprise communications

7、 Restful

嵌入式实操----基于RT1170 FreeRTOS实现CPU使用率统计(二十四)

【语义分割】2018-DeeplabV3+ ECCV

Analyzing the curriculum design evaluation system of steam Education

UE4 switching of control rights of multiple roles

Working principle and application of fast recovery diode
随机推荐
Compiled by egg serialize TS
How to build an automated testing framework?
【学习笔记】AGC041
计算离散点的曲率(matlab)
11、 Exception handler
Spark Structured Streaming HelloWorld
FFmpeg 视频编码
【语义分割】2018-DeeplabV3+ ECCV
autocomplete禁止表单自动填充
3、 @requestmapping annotation
Recursive implementation of exponential enumeration
UE4 获取玩家控制权的两种方式
SQL encryption and decryption injection details
QT compilation error sorting and remote module Download
Array sort 3
User defined type details
2022 a.static query on tree (tree section)
性能和成本的综合架构:单元化架构
「游戏引擎 浅入浅出」4. 着色器
Working principle and application of fast recovery diode