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);
- int i;
- string word;
- for(i = 0; i < query.size(); i++){
- if(query[i] != ' '){
- word += query[i];
- }
- else{
- cout << "["s << word << "]"s << endl;
- word = ""s;
- }
- }
- cout << "["s << word << "]"s << endl;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement