/******************************************************************************
Online C Compiler.
Code, Compile, Run and Debug C program online.
Write your code in this editor and press "Run" button to compile and execute it.
*******************************************************************************/
#include <stdio.h>
int main()
{
printf("Hello World\n");
int mas[] = {-1, 2, 3, 0, 6, -7, 8, 10, 0, 1};
int N = 10;
int i;
int maxCount = 0;
int maxLength = 0;
int count = 0;
int length = 0;
for (i = 0; i < N - 1; i++)
{
if (mas[i] == 0)
{
if (length > maxLength)
{
maxLength = length;
maxCount = count;
}
length = 0;
count = 0;
}
else
{
length++;
}
if ((mas[i] > 0 && mas[i + 1] < 0) || (mas[i] < 0 && mas[i + 1] > 0))
count++;
}
if (length > maxLength)
{
maxLength = length;
maxCount = count;
}
printf("%d, %d", maxLength, maxCount);
return 0;
}