Advertisement
Guest User

Untitled

a guest
Oct 18th, 2019
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.80 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2. #include <iostream>
  3.  
  4. using namespace std;
  5.  
  6. string words, str1, str2, str3;
  7.  
  8. void read_string() {
  9.     int n, flag = 0;
  10.     char caracter;
  11.  
  12.     cin >> n;
  13.  
  14.     //int spaces = n;
  15.  
  16.     for (int i = 0; i < words.size(); ++i) {
  17.  
  18.         if (caracter == '#' || caracter == ' ') {
  19.             if (flag == 0) {
  20.                 str1.push_back(caracter);
  21.             } else {
  22.                 str3.push_back(caracter);
  23.             }
  24.         } else {
  25.             str2.push_back(caracter);
  26.         }
  27.     }
  28.     cout << str3 << str2 << str1 << endl;
  29. }
  30.  
  31. int main() {
  32.     int quant, i;
  33.     int n;
  34.     cin >> quant;
  35.  
  36.     for (i = 0; i < quant; ++i) {
  37.         cin >> n;
  38.         cin >> words;
  39.         cout << words << endl;
  40.         //read_string();
  41.     }
  42.  
  43.     return 0;
  44. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement