Câu 1:
uses crt;
const fi='tinhoc11.out';
var a:array[1..49]of integer;
n,i:integer;
f1:text;
begin
clrscr;
assign(f1,fi); rewrite(f1);
write('Nhap n='); readln(n);
for i:=1 to n do
begin
write('A[',i,']='); readln(a[i]);
end;
for i:=1 to n do
write(f1,a[i]:4);
close(f1);
readln;
end.
Câu 2:
const fi='dayso.pas';
fo='baitap.pas';
var a:array[1..100]of integer;
n,i,dem:integer;
f1,f2:text;
begin
assign(f1,fi); reset(f1);
assign(f2,fo); rewrite(f2);
n:=0;
while not eoln(f1) do
begin
inc(n);
read(f1,a[n]);
end;
dem:=0;
for i:=1 to n do
if a[i] mod 4=0 then inc(dem);
writeln(f2,dem);
close(f1);
close(f2);
end.