Răspuns:
1)
#include <iostream>
using namespace std;
int main(int argc, char *argv[])
{
int n,b,a=0;
cin>>n;
for(int i=0;i<n;i++){
cin>>b; a=b+a;
if (b%2==0) cout<<"este par"<<endl;
}
cout<<a;
}
2)
#include <iostream>
using namespace std;
int main(int argc, char *argv[])
{
int n,b,a=0,c=0;
cin>>n;
for(int i=0;i<n;i++){
cin>>b;
if (b>0) c++;
if((b>-100 and b<10) or (b>20 and b<50)){
a+=b;
}
}
cout<<"numere strict pozitive: "<<c<<endl;
cout<<"suma numerelor din intervalul dat: "<<a;
}