Advertisement
This is comment for paste
Основы С++ / Тема 2 / Урок 6. Цикл for и выход из цикла / Задача 3
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- using namespace std;
- int main() {
- string query;
- getline(cin, query);
- cout << "[";
- string word;
- for (int i = 0; i < query.size(); ++i)
- {
- word = query[i];
- if (word != " ")
- {
- cout << word;
- } else
- {
- cout << "]" << endl << "[";
- }
- }
- cout << "]";
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement