Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- int main() {
- int last_now, now, amount = 0, amount_now = 0;
- std::cin >> now;
- if (now > 0) {
- amount = amount_now = 1;
- }
- while (now != 0) {
- last_now = now;
- std::cin >> now;
- if (now == last_now) {
- amount_now += 1;
- if (amount_now > amount) {
- amount = amount_now;
- }
- } else {
- amount_now = 1;
- }
- }
- std::cout << amount;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement