Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- using namespace std;
- int main()
- {
- int n;
- string s;
- cin >> n;
- cin.ignore();
- for(int i = 0; i < n; i++)
- {
- getline(cin, s);
- string t;
- for(int j = 0; j < s.size(); j++)
- if(j == s.size() - 1 || (s[j] != '.' && s[j] != ',' && s[j] != '!' && s[j] != '?'))
- t += s[j];
- cout << t << "\n";
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement