Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cstring>
- using namespace std;
- char s[256], * p;
- char new_s[16][256];
- int main()
- {
- int i, j, n;
- char last;
- cin >> n;
- n++;
- for(i = 0, j = 0; i < n; i++)
- {
- cin.getline(s, 256);
- last = s[strlen(s) - 1];
- p = strtok(s, ".!?,");
- while(p)
- {
- strcat(new_s[j], p);
- p = strtok(NULL, ".!?,");
- }
- if(!isalpha(last))
- strncat(new_s[j], &last, 1);
- j++;
- }
- for(i = 1; i < j; i++)
- cout << new_s[i] << '\n';
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement