tham khảo
program tinhoc;
uses crt;
var n,dem,tich:integer;
a: array[1..1000] of integer;
begin
clrscr;
writeln('Nhap so phan tu cua day: ');readln(n);
writeln('Nhap ',n,' phan tu cua day: ');
for i:= 1 to n do readln(a[i]);
dem:=0; tich:=1;
for i:= 1 to n do if a[i] mod 2 = 0 then begin dem:=dem+1; tich:=tich*a[i] end;
writeln('Co ',dem,' phan tu chan trong day');
writeln('Tich cua cac so chan trong day la: ',tich);
readln
end.
#include <bits/stdc++.h>
using namespace std;
long long x,n,i,dem;
int main()
{
cin>>n;
dem=0;
for (i=1; i<=n; i++)
{
cin>>x;
if (x>0) dem++;
}
cout<<dem;
return 0;
}