Advertisement
Guest User

Untitled

a guest
Jun 25th, 2019
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2.  
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7. int n;
  8. char t[256];
  9. char sp[] = {".,?!"};
  10.  
  11. cin >> n;
  12.  
  13. cin.get();
  14.  
  15. for(int i=0; i<n; i++)
  16. {
  17. cin.getline(t, 256);
  18.  
  19. for(int i=0; t[i]; i++)
  20. {
  21. if((strchr(sp, t[i])) && (i < strlen(t)- 1))
  22. {
  23. strcpy(t+i, t+i+1);
  24. i--;
  25. }
  26. }
  27.  
  28. cout << t << endl;
  29. }
  30.  
  31. return 0;
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement