Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <conio.h>
- #include <cstring>
- using namespace std;
- int main()
- {
- setlocale(LC_ALL, "Rus");
- cout<<"Введите строку:"<<endl<<endl;
- string str, pstr;
- getline(cin, str);
- int x = sizeof(str);
- for(int i = 0; i < x; i++)
- {
- x = str.find(' ');
- pstr = str.erase(x, x);
- }
- cout<<"Результат: "<<str<<endl;
- _getch();
- return 0;
- }
Add Comment
Please, Sign In to add comment