Untitled
Anonymous
c_cpp
10/22/2023 9:52 AM
676 B
16
Indexable
#include <iostream>
using namespace std;
int main()
{
bool secondZero = false; // 0
int max = -1;
int tmp;
bool konec = false;
while (!konec) {
cin >> tmp;
if (tmp == 0) {
if (secondZero == true) {
konec = true;
}
else if (secondZero == false) secondZero = true;
}
else {
secondZero = false;
if (tmp > max) max = tmp;
}
}
cout << max;
}Editor is loading...