Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- /* Define your function here */
- string RemoveSpaces(string userString)
- {
- string final = "";
- int size = userString.size();
- for(int i = 0; i < size; i++)
- {
- char character = userString.at(i);
- if(userString.at(i) != ' ')
- {
- final = final + character;
- }
- }
- return final;
- }
- int main() {
- /* Type your code here. Your code must call the function. */
- string a;
- getline(cin, a);
- cout << RemoveSpaces(a) << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement