1 solutions

  • 0
    @ 2023-1-21 21:26:14
    #include <iostream>
    using namespace std;
    int main()
    {
        int n,a[100],num=0,max=-1;
        cin >> n;
        for(int i=0;i<n;i++)
        {
            cin >> a[i];
        }
        for(int i=0;i<n;i++)
        {
            if(a[i]%2==0)
            {
                num++;
            }
            if(a[i]%2==1)
            {
                num=0;
            }
            if(num>max)
            {
                max=num;
            }
        }
        cout << max;
        return 0;
    }
    
    
    • 1

    Information

    ID
    1509
    Time
    1000ms
    Memory
    128MiB
    Difficulty
    10
    Tags
    # Submissions
    1
    Accepted
    1
    Uploaded By