SHARE
TWEET

Untitled

a guest Nov 19th, 2019 78 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. /* Define your function here */
  5. string RemoveSpaces(string userString)
  6. {
  7.    string final = "";
  8.    
  9.    
  10.    int size = userString.size();
  11.    for(int i = 0; i < size; i++)
  12.    {
  13.       char character = userString.at(i);
  14.     if(userString.at(i) != ' ')
  15.     {
  16.       final = final + character;
  17.     }
  18.    }
  19.    return final;
  20.    
  21. }
  22.  
  23. int main() {
  24.    /* Type your code here. Your code must call the function.  */
  25.    string a;
  26.    getline(cin, a);
  27.    cout << RemoveSpaces(a) << endl;
  28.    return 0;
  29. }
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