first 7 Introductory problems

This commit is contained in:
2024-06-01 13:03:48 +02:00
parent d1fa3383f0
commit ca126c7a0a
8 changed files with 167 additions and 0 deletions

View File

@@ -0,0 +1,25 @@
// Repetitions
#include<bits/stdc++.h>
using namespace std;
int main() {
string s;
cin >> s;
int max_count = 0;
int current_count = 0;
char current = ' ';
for (auto c : s) {
if (c == current) {
current_count ++;
max_count = max(max_count, current_count);
} else {
current = c;
current_count = 1;
max_count = max(max_count, current_count);
}
}
cout << max_count << endl;
return 0;
}