Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- #include <vector>
- #include <algorithm>
- #include <sstream>
- #include <queue>
- using namespace std;
- /**
- * Auto-generated code below aims at helping you parse
- * the standard input according to the problem statement.
- **/
- int main()
- {
- int L;
- cin >> L; cin.ignore();
- int H;
- cin >> H; cin.ignore();
- string T;
- vector<vector<char>>art;
- vector<vector<char>>output;
- queue<int>indexes;
- getline(cin, T);
- for (int i = 0; i < H; i++) {
- string ROW;
- getline(cin, ROW);
- vector<char>temp;
- for( char &letter : ROW)
- {
- temp.push_back(letter);
- }
- art.push_back(temp);
- }
- int indexInArt=0;
- for(char letter : T)
- {
- indexInArt=0;
- if(letter>='a' && letter<='z')
- {
- indexInArt=letter-'a'+1;
- }else if (letter>='A' && letter<='Z')
- {
- indexInArt=letter-'A'+1;
- }else if (letter==' ')
- {
- indexInArt=32;
- }else
- {
- indexInArt=27;
- }
- indexes.push(indexInArt);
- }
- while(!indexes.empty())
- {
- int index=indexes.front();
- for(int row=0; row<H; ++row)
- {
- vector<char>temp;
- for(int col=(index*L)-4; col<index*L; ++col)
- {
- temp.push_back(art[row][col]);
- }
- output.push_back(temp);
- }
- indexes.pop();
- }
- for(auto a :output)
- {
- for(auto b : a)
- {
- cout<<b;
- }
- cout<<endl;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement