Advertisement
Jayss8

WCIPEG Mispelling (C++)

Jun 22nd, 2014
323
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.37 KB | None | 0 0
  1. #include <iostream>
  2. #include <string>
  3.  
  4. using namespace std;
  5.  
  6. int main()
  7. {
  8.     int i, n;
  9.     int a[1000];
  10.     string s[1000];
  11.  
  12.     cin >> i;
  13.  
  14.     for (n = 0; n <= i - 1; n++)
  15.     {
  16.         cin >> a[n];
  17.         cin.ignore(256, ' ');
  18.         getline(cin, s[n]);
  19.  
  20.         s[n] = s[n].erase(a[n] - 1, 1);
  21.     }
  22.  
  23.     for (n = 0; n <= i - 1; n++)
  24.     {
  25.         cout << n + 1 << " " << s[n] << endl;
  26.     }
  27.     return 0;
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement