Advertisement
Mihai_Preda

Untitled

Mar 11th, 2021
278
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.43 KB | None | 0 0
  1. #include <iostream>
  2. #include <string>
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7.     int n;
  8.     string s;
  9.     cin >> n;
  10.     cin.ignore();
  11.     for(int i = 0; i < n; i++)
  12.     {
  13.         getline(cin, s);
  14.         string t;
  15.         for(int j = 0; j < s.size(); j++)
  16.             if(j == s.size() - 1 || (s[j] != '.' && s[j] != ',' && s[j] != '!' && s[j] != '?'))
  17.                 t += s[j];
  18.         cout << t << "\n";
  19.     }
  20.     return 0;
  21. }
  22.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement