program Tinh_tong;
uses crt;
var S,i:integer;
begin
S:=0;
for i:=1 to 50 do S:=S+i;
writeln('Tong tu 1 den 50 la:',S);
readln
end.
Cau 2:
program Tinh_tong_2;
uses crt;
var S,i,n: integer;
begin
writeln('Nhap n:');
readln(n);S:=0;
for i:=1 to n do (S:=S + 1/n*(n+1));
writeln('Tong la:',S);
readln
end.
Cau 3
program Tim_tich;
uses crt;
var a:array[1..50] of integer;
i.n.S: integer;
begin
writeln('Nhap vao sp phan tu:');
readln(n); S:=1;
for i:=1 to n do
begin
writeln('a[',i,']=');
readln(a[i]);
end;
for i:=1 to n do if a[i] mod 2=0 then S:=S*a[i];
writeln('Tich la:',S);
readln
end.