Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <windows.h>
- #include <string>
- using namespace std;
- int main()
- {
- SetConsoleOutputCP(1251);
- SetConsoleCP(1251);
- string text{}, result{};
- int i{};
- cout << "Введіть будь-який текст:" << endl;
- getline(cin, text);
- for (i = 0; i < text.size(); i++) {
- if (text[i] != ' ') {
- result += text[i];
- }
- }
- cout << "Текст після видалення пробілів:" << endl << result;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement