Răspuns :
#include <iostream>
using namespace std;
int main()
{
int A[10001], B[10001], n, pare1 = 0, pare2 = 0, s = 0;
cin >> n;
for( int i = 1; i <= n; ++i )
{
cin >> A[i];
if( A[i] % 2 == 0 )
pare1++, s += A[i];
}
for( int i = 1; i <= n; ++i )
{
cin >> B[i];
if( A[i] % 2 == 0 )
pare2++, s += B[i];
}
cout << pare1 << " elemente pare in primul vector" << '\n';
cout << pare2 << " elemente pare in al doilea vector" << '\n';
cout << "Suma lor este: " << s;
return 0;
}
using namespace std;
int main()
{
int A[10001], B[10001], n, pare1 = 0, pare2 = 0, s = 0;
cin >> n;
for( int i = 1; i <= n; ++i )
{
cin >> A[i];
if( A[i] % 2 == 0 )
pare1++, s += A[i];
}
for( int i = 1; i <= n; ++i )
{
cin >> B[i];
if( A[i] % 2 == 0 )
pare2++, s += B[i];
}
cout << pare1 << " elemente pare in primul vector" << '\n';
cout << pare2 << " elemente pare in al doilea vector" << '\n';
cout << "Suma lor este: " << s;
return 0;
}