SHARE
TWEET

Untitled

a guest Jun 25th, 2019 44 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.     int length=0;
  9.     char t[256];
  10.     char sp[] = {".,?!"};
  11.     char p[256] = {0};
  12.     char w[256];
  13.  
  14.     cin >> n;
  15.  
  16.     cin.get();
  17.  
  18.     for(int i=0; i<n; i++)
  19.      {
  20.          cin.getline(t, 256);
  21.  
  22.          for(int i=0; t[i]; i++)
  23.          {
  24.              if((strchr(sp, t[i])) && (i < strlen(t)- 1))
  25.                 {
  26.                     strcpy(t+i, t+i+1);
  27.                     i--;
  28.                 }
  29.             w[p[length]] = t[i];
  30.             length ++;
  31.          }
  32.      }
  33.  
  34.      for(int i=0; i<n; i++)
  35.          cout << w[i] << endl;
  36.  
  37.  
  38.  
  39.     return 0;
  40. }
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