SHARE
TWEET

Untitled

a guest Jun 25th, 2019 50 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top