Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main() {
- int k = 1, m = 1, n;
- cin >> n;
- while (n > 9) {
- if (n % 10 == n / 10 % 10) {
- k++;
- if (k > m) {
- m = k;
- } else {
- k = 1;
- }
- }
- n /= 10;
- }
- cout << m << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement