aboutsummaryrefslogtreecommitdiff
path: root/01_introductory_problems/repetitions_1069.cpp
blob: 790f3152cbc56a1fae613d6f14b5ad511e758853 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#include <algorithm>
#include <iostream>
#include <string>

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;
}

Generated with cgit - Back to sebastiano.tronto.net