#include using namespace std;
int main()
{
int n, max = 0, cnt = 0, min = 0;
while (cin >> n)
{
if (n == 0)break;
if (max == n)
{
if (min > cnt)
min = cnt;
if (min == 0)
min = cnt;
cnt = 0;
}
if (max> n)
cnt++;
}
cout << min;
return 0;
}
преобразовать while в цикл