当前位置:网站首页>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;
}
边栏推荐
猜你喜欢

ES6 modularization +commonjs

QT compilation error sorting and remote module Download

SQL encryption and decryption injection details

SQL加解密注入详解

Steam science education endows classroom teaching with creativity

Codeforces Round #807 (Div. 2)

MySQL - multi table query - Cartesian product sum, correct multi table query, equivalent connection and unequal connection, inner connection and outer connection

Postman 导入curl 、导出成curl、导出成对应语言代码

Ffmpeg video coding
![[semantic segmentation] 2018-deeplabv3+ ECCV](/img/c9/d1e2d7e63df8db2a7fa2bde31b10f7.png)
[semantic segmentation] 2018-deeplabv3+ ECCV
随机推荐
性能和成本的综合架构:单元化架构
5、 Domain objects share data
data warehouse
[learning notes] agc041
[uoj 429] runs (inclusive) + a little record about Lyndon tree and its application
IEC61131 数据类型与 C#数据类型的对应
Array sort 3
Keil V5 installation and use
Autocomplete prevents the form from automatically filling in
Whether the SQL that fails to execute MySQL is counted into the slow query?
ES6 modularization +commonjs
【300+精选大厂面试题持续分享】大数据运维尖刀面试题专栏(八)
UE4 switching of control rights of multiple roles
十、拦截器
【语义分割】2018-DeeplabV3+ ECCV
Database startup message: ora-29702: error occurred in cluster group service
Steam科学教育赋予课堂教学的创造力
这种是我的vs没连上数据库吗
9、 File upload and download
qt编译报错整理及Remote模块下载