/
ch1ppo
/
Labubusi
Обзор
Документация
Войти
/
ch1ppo
/
Labubusi
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
master
lab6.cpp
32 строки
771 B
ch1ppo
upload files
28 ноя 2025, 13:56
28 ноя 2025, 13:56
a8db75f
Код
Авторство
О чём код?
#include <iostream> #include <string> using namespace std; int main() { setlocale(LC_ALL, "ru"); string text; cout << "Введите строку: "; getline(cin, text); int count5 = 0; int current_len = 0; for (unsigned i = 0; i <= text.length(); i++) { if (i < text.length() && (text[i] == '0' || text[i] == '1')) { current_len++; } else { if (current_len == 5) count5++; current_len = 0; } } cout << "Исходная строка: " << text << endl; cout << "Количество групп по 5 символов: " << count5 << endl; return 0; }