Varianta 85 / Subiectul 3 / Problema 3 |
#include<iostream.h> void main() {int a[50],b[50],n,i,s=0,k=0; cin>>n; for(i=1;i<=n;i++) cin>>a[i]; for(i=1;i<=n;i++) cin>>b[i]; for(i=1;i<=n;i++) if(a[i]%2==0) {s+=a[i]; k++; } float p=(float)s/k; s=0; for(i=1;i<=n;i++) if(b[i]<p) s=s+b[i]; cout<<s; } |