Advertisement
Guest User

Untitled

a guest
Oct 31st, 2014
165
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.67 KB | None | 0 0
  1. #include <iostream>
  2. #include <string>
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7.     string input;       //input to be cleaned
  8.     string output;      //output
  9.     int length_i;       //strlen of input
  10.     int length_o;       //strlen of output
  11.     bool found;         //checks if [ has been reached and waiting for ]
  12.  
  13.  
  14.     found = false;
  15.  
  16.     cout << "Enter string to be cleaned:" << endl;
  17.     cin >> input;
  18.  
  19.     length = strlen(input);
  20.     for (int i = 0; i < length; i++)
  21.     {
  22.         //if we are in the brackets, we don't want to add to the string
  23.         if (found == true)
  24.         { }
  25.         else
  26.         { }
  27.         if (input[i] == '['){
  28.             if (found == true){
  29.                 found = false;
  30.             }
  31.             else
  32.             {
  33.                 found = true;
  34.             }
  35.         }
  36.         if ()
  37.     }
  38. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement