From 96254947699986c59f0dc63d69fd4b76bd3ed43e Mon Sep 17 00:00:00 2001 From: Sebastiano Tronto Date: Mon, 6 Jul 2026 19:08:08 +0200 Subject: Initial commit --- 01_introductory_problems/repetitions_1069.cpp | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 01_introductory_problems/repetitions_1069.cpp (limited to '01_introductory_problems/repetitions_1069.cpp') diff --git a/01_introductory_problems/repetitions_1069.cpp b/01_introductory_problems/repetitions_1069.cpp new file mode 100644 index 0000000..790f315 --- /dev/null +++ b/01_introductory_problems/repetitions_1069.cpp @@ -0,0 +1,20 @@ +#include +#include +#include + +int main() { + char cur{'x'}; + int n{0}, m{0}; + std::string str; + std::cin >> str; + for (auto c : str) { + if (c == cur) { + n++; + } else { + m = std::max(m, n); + n = 1; + cur = c; + } + } + std::cout << std::max(m, n) << std::endl; +} -- cgit v1.3