Bài 1:
uses crt;
var a:array[1..1000]of integer;
n,i,t,dem:integer;
begin
clrscr;
write('n='); readln(n);
for i:=1 to n do
begin
write('a[',i,']='); readln(a[i]);
end;
dem:=0;
t:=0;
for i:=1 to n do
if (a[i]>0) and (a[i] mod 2<>0) then
begin
inc(dem);
t:=t+a[i];
end;
writeln(t/dem:4:2);
readln;
end.
Bài 2:
uses crt;
var s:string;
i,d:integer;
kt:boolean;
begin
clrscr;
write('Nhap xau:'); readln(s);
d:=length(s);
for i:=1 to d do
if s[i]=' ' then delete(s,i,1);
s:=upcase(s);
writeln(s);
readln;
end.