#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; }
By signing up a 追梦算法网 universal account, you can submit code and join discussions in all online judging services provided by us.
Using your 追梦算法网 universal account