2 câu trả lời
program bai_giai;
uses crt;
var A:array[1..10000] of integer;
n,i,t:longint;
begin
clrscr;
readln(n);
for i:=1 to n do read(A[i]);
t:=0;
for i:=1 to n do
if A[i] mod 2=1 then t:=t+A[i];
write(t);
readln;
end.
Program baitap;
Uses crt;
Var A:array[1..200] of integer;
i,n,le:integer;
Begin
Clrscr;
Write('So cac so phan tu:'); Readln(n);
le:=0;
For i:=1 to n do
Begin
Write('A[',i,']=');
Readln(A[i]);
If A[i] mod 2=1 then le:=le+A[i];
End;
Writeln('Tong cac phan tu la so le:',le);
Readln
End.