Hãy nhập câu hỏi của bạn vào đây, nếu là tài khoản VIP, bạn sẽ được ưu tiên trả lời.
uses crt;
var i:integer;
a:array[1..20]of string;
begin
clrscr;
for i:=1 to 20 do readln(a[i]);
for i:=1 to 20 do
writeln('Xin chao, ban thu ',i,' ten la: ',a[i]);
readln;
end.
Program Hoc24;
var i: byte;
begin
for i:=1 to 20 do
writeln('Chao ban thu ',i);
readln
end.
Đề 1:
uses crt;
var a:array[1..100]of integer;
i,n,min:integer;
begin
clrscr;
write('Nhap n='); readln(n);
for i:=1 to n do
begin
write('A[',i,']='); readln(a[i]);
end;
min:=a[1];
for i:=1 to n do
if min>a[i] then min:=a[i];
writeln(min);
readln;
end.
Đề 2:
uses crt;
var a:array[1..100]of integer;
i,n,max:integer;
begin
clrscr;
write('Nhap n='); readln(n);
for i:=1 to n do
begin
write('A[',i,']='); readln(a[i]);
end;
max:=a[1];
for i:=1 to n do
if max<a[i] then max:=a[i];
writeln(max);
readln;
end.
uses crt;
var a,b,c:real;
begin
clrscr;
write('nhap chieu cao cua ban thu 1:'); readln(a);
write('nhap chieu cao cua ban thu 2:'); readln(b);
write('nhap chieu cao cua ban thu 3:'); readln(c);
nn:=a;
if nn>b then nn:=b;
if nn>c then nn:=c;
writeln('ban co chieu cao thap nhat la: ',nn);
readln;
end.
program chieu_cao;
uses crt;
var a,b,c:integer;
begin
clrscr;
write('nhap bn thu nhat');readln(a);
write('nhap bn thu hai:');readln(b);
write('nhap bn thu ba:');readln(c);
if (a<b) and (a<c) then writeln('bn thu nhat thap nhat')
if (b<c) and (b<a) then writeln('bn thu hai thap nhat')
else writeln('bn thu ba thap nhat');
readln
end.
OK
program DiemTrungBinh;
var
i, n: integer;
diem, tong: real;
begin
n := 40;
tong := 0;
for i := 1 to n do
begin
write('Nhap diem cua hs ', i, ': ');
readln(diem);
tong := tong + diem;
end;
writeln('Diem cua lop la: ', tong / n:0:2);
readln;
end.
refer
uses crt;
var i,n:longint;
a:array[1..100] of real;
s1,s,max,min:real;
begin
clrscr;
write('Nhap n: '); readln(n);
for i:=1 to n do
begin
write('Diem trung binh mon tin hoc cua ban thu ',i,' la: ');readln(a[i]);
end;
min:=a[1];max:=a[1];
for i:=2 to n do begin
if a[i]>max then max:=a[i];
if a[i]<min then min:=a[i]; end;
for i:=1 to n do
s:=s+a[i];
s1:=s/n;
writeln('So diem cao nhat la: ',max);
writeln('So diem thap nhat la: ',min);
write('Diem TB cua ca lop la: ',s1:0:1);
readln
Var a:array:[1..1000] of real;
i,n:integer;
max,min,s,tb:real;
Begin
Write('Nhap so luong hoc sinh: ');readln(n);
For i:=1 to n do
Begin
Write('Nhap chieu cao hs thu ',i,' = ');readln(a[i]);
s:=s+a[i];
End;
tb:=s/n;
max:=a[1];min:=a[1];
For i:=2 to n do
Begin
if a[i] > max then max:=a[i];
if a[i] < min then min:=a[i];
end;
writeln('Chieu cao lon nhat la ',max:10:1);
Writeln('Chieu cao nho nhat la ',min:10:1);
Write('Chieu cao trung binh la ',tb:10:1);
Readln
End.
uses crt;
var a,b:integer;
begin
clrscr;
readln(a,b);
if (a>0) and (b>0) then writeln(a*b)
else writeln('Nhap lai');
readln;
end.
Câu 1:
uses crt;
var a:array[1..100]of integer;
i,n,t:integer;
begin
clrscr;
write('Nhap n='); readln(n);
for i:=1 to n do
begin
write('A[',i,']='); readln(a[i]);
end;
t:=0;
for i:=1 to n do
t:=t+a[i];
writeln(t);
readln;
end.
Câu 2:
uses crt;
var a:array[1..100]of integer;
i,n,x,dem,kt:integer;
begin
clrscr;
write('Nhap n='); readln(n);
for i:=1 to n do
begin
write('A[',i,']='); readln(a[i]);
end;
write('Nhap x='); readln(x);
kt:=0;
dem:=0;
for i:=1 to n do
if a[i]=x then
begin
kt:=1;
write(i:4);
inc(dem);
end;
if kt=0 then writeln('Khong co ',x,' trong day');
writeln(x,' xuat hien ',dem,' lan trong day');
readln;
end.