Untitled

mail@pastecode.io avatar
unknown
plain_text
a year ago
338 B
2
Indexable
Never
#include<iostream>
using namespace std;
int main() {
	bool sz = false;
	int y;
	int max = 0;
	while (cin >> y)
	{
		if (y > max)
		{
			max = y;
		}
		if (y == 0)
		{
			if (sz == 1)
			{
				break;
			}
			if (sz == 0)
			{
				sz = 1;
			}
		}
		if (y != 0)
		{
			sz = 0;
		}
	}
	cout << max;
	return 0;
}