Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std;
- typedef vector <string> vc;
- vc vstr1, vstr2; //one saves the first word and two saves the second word, which is next to the english word
- string str; //for reading
- string word_english; //save the english word
- int main() {
- int readings, amount_words;
- int count = 0;
- cin >> readings;
- for (int i = 0; i < readings; ++i) {
- cin >> amount_words;
- for (int j = 0; j < amount_words; ++j) {
- cin >> str [j];
- if (str[j] != '#') {
- word_english = str [j];
- ++count;
- }
- else if (count > 0) {
- vstr2.push_back(str[j]);
- }
- else if (str[j] == '#') {
- vstr1.push_back(str[j]);
- }
- }
- }
- for (int i = 0; i < vstr2.size(); ++i) {
- cout << vstr2 [i] << " ";
- }
- cout << word_english;
- for (int i = 0; i < vstr1.size(); ++i) {
- cout << vstr1 [i] << " ";
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement