1. var
i,k:longint;
n:longint;
a:array[1..1000] of longint;
result:longint;
BEGIN
write('nhap vao so n:');
read(n);
writeln('nhap vao lan luot cac so cua day:');
for i:=1 to n do
readln(a);
write('nhap vao so k:');
read(k);
writeln;
writeln('cac vi tri co xuat hien so k la:');
for i:=1 to n do
if a=k then
begin
writeln(i);
inc(result);
end;
write('so vi tri xuat hien so k la:',result);
END.
2. var
i,k:longint;
n:longint;
a:array[1..1000] of longint;
result1,result2:longint;
BEGIN
write('nhap vao so n:');
read(n);
writeln('nhap vao lan luot cac so cua day:');
for i:=1 to n do
readln(a);
writeln('cac vi tri co so >=10 la:');
for i:=1 to n do
if a>=10 then
begin
writeln(i);
inc(result1);
end;
writeln('cac vi tri co so <=20 la:');
for i:=1 to n do
if a<=20 then
begin
writeln(i);
inc(result2);
end;
writeln('so vi tri co so >=10 la:',result1);
writeln('so vi tri co so <=20 la:',result2);
readln;
END.
3. VAR
i,j:longint;
tmp:longint;
n:longint;
a:array[1..1000] of longint;
BEGIN
write('nhap vao so n:');
read(n);
writeln('nhap vao lan luot cac so cua day:');
for i:=1 to n do
readln(a);
for i:=1 to n do
for j:=i+1 to n do
if a>a[j] then
begin
tmp:=a;
a:=a[j];
a[j]:=tmp;
end;
writeln('day so sau khi sap xep la:');
for i:=1 to n do
writeln(a);
readln;
END.
5. VAR
lop,hoten,gioitinh:array[1..1000] of string;
n,i:longint;
tb:real;
ngaysinh,toan,van,anh,sinh,su,dia,tin,td,kithuat:array[1..1000] of real;
BEGIN
writeln('nhap vao so hoc sinh:');
read(n);
writeln('nhap lan luot cac thong tin:');
for i:=1 to n do
begin
writeln('lop');
if i=1 then
readln(lop[1]);
readln(lop);
writeln('hoten:');
readln(hoten);
writeln('gioitinh:');
read(gioitinh);
writeln('toan');
readln(toan);
writeln('van');
readln(van);
writeln('anh');
readln(anh);
writeln('sinh');
readln(sinh);
writeln('su');
readln(su);
writeln('dia');
readln(dia);
writeln('tin');
readln(tin);
writeln('td');
readln(td);
writeln('kithuat');
readln(kithuat);
end;
writeln('xep loai cac hoc sinh:');
for i:=1 to n do
begin
tb:=(toan+toan+van+van+anh+anh+sinh+su+dia+tin+td+kithuat)/12;
writeln('diem tb mon cua hoc sinh nay la:',tb);
if tb>=9 then
writeln('hoc sinh nay loai xuat sac:')
else
if tb>=8 then
writeln('hoc sinh nay loai gioi:')
else
if tb>=6.5 then
writeln('hoc sinh nay loai kha:')
else
if tb>=5 then
writeln('hoc sinh nay loai tb:')
else
if tb<5 then
writeln('hoc sinh nay loai yeu:');
writeln('lop');
writeln(lop);
writeln('hoten:');
writeln(hoten);
writeln('gioitinh:');
writeln(gioitinh);
writeln('toan');
writeln(toan:1:1);
writeln('van');
writeln(van:1:1);
writeln('anh');
writeln(anh:1:1);
writeln('sinh');
writeln(sinh:1:1);
writeln('su');
writeln(su:1:1);
writeln('dia');
writeln(dia:1:1);
writeln('tin');
writeln(tin:1:1);
writeln('td');
writeln(td:1:1);
writeln('kithuat');
writeln(kithuat:1:1);
end;
END.
tin đây
câu 4 đề ko rõ ko làm
câu 6 thì dễ ko hỏi, tự làm
ai lấy luôn thì lấy
ko thì mai foto