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.
Var a:array:[1..50] of real;
i,max:integer;
Begin
For i:=1 to 50 do
Begin
Write('Nhap so thu ',i,' = ');readln(a[i]);
End;
Write('Cac diem vua nhap la: ');
For i:=1 to 50 do
Write(a[i]:10:2);
Writeln;
max:=a[1];
For i:=2 to 50 do
if a[i]>max then max:=a[i];
Write('Diem trung binh lon nhat la ',max:10:2);
Readln
End.
Var a:array:[1..50] of real;
i:integer;
max:real;
Begin
For i:=1 to 50 do
Begin
Write('Nhap diem thu ',i,' = ');readln(a[i]);
End;
Write('Cac diem vua nhap la: ');
For i:=1 to 50 do
Write(a[i]:10:2);
writeln;
max:=a[1];
For i:=2 to 50 do
if a[i] > max then max:=a[i];
write('Diem lon nhat la ',max:10:2);
Readln
End.
uses crt;
var diem:real;
begin
clrscr;
repeat
write('Nhap diem trung binh:'); readln(diem);
until (0<=diem) and (diem<=10);
if diem<5 then writeln('Xep loai yeu')
else if (5<=diem) and (diem<6.5) then writeln('Xep loai trung binh')
else if (6.5<=diem) and (diem<8.0) then writeln('Xep loai kha')
else writeln('Xep loai gioi');
readln;
end.
uses crt;
var a,b,c,tb:array[1..10]of real;
ln,nn:real;
i:integer;
begin
clrscr;
for i:=1 to 10 do readln(a[i],b[i],c[i]);
for i:=1 to 10 do
tb[i]:=(a[i]+b[i]+c[i])/3;
ln:=0;
nn:=10;
for i:=1 to 10 do
begin
if ln<tb[i] then ln:=tb[i];
if nn>tb[i] then nn:=tb[i];
end;
writeln(ln:4:2);
writeln(nn:4:2);
for i:=1 to 10 do
begin
if tb[i]>=5 then writeln('Ban thu ',i,' Dat')
else writeln('Ban thu ',i,'Chua dat');
end;
readln;
end.
1)
Var array:[1..1000] of integer;
i,n,t:integer;
Begin
Write('n = ');readln(n);
For i:=1 to n do
Begin
Write('Nhap so thu ',i,' = ');readln(a[i]);
End;
For i:=1 to n do
If a[i] > a[i+1] then
Begin
t:=a[i];
a[i]:=a[i+1];
a[i+1]:=t;
End;
Write('Sap xep tang dan ');
For i:=1 to n do write(a[i]:8);
Readln
End.
2)
Var array:[1..1000] of integer;
i,n,t:integer;
Begin
Write('n = ');readln(n);
For i:=1 to n do
Begin
Write('Nhap so thu ',i,' = ');readln(a[i]);
End;
For i:=1 to n do
If a[i] < a[i+1] then
Begin
t:=a[i];
a[i]:=a[i+1];
a[i+1]:=t;
End;
Write('Sap xep giam dan ');
For i:=1 to n do write(a[i]:8);
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
Uses crt;
Var k: array[1..10] of integer;
i,j,n: byte;
t: integer;
begin clrscr;
Readln(n);
For i:=1 to n do Begin
readln(k[i]);
end;
For i:=1 to n-1 do For j:=i+1 to n do
if k[j] <=k[i] then begin
t:= k[i];
k[i]:=M[j];
k[j]:=t; end;
For i:=1 to n do Write(k[i],';'); readln;
end.
uses crt;
var a:array[1..100]of real;
i,n,dem1,dem2,dem3,dem4:integer;
begin
clrscr;
readln(n);
for i:=1 to n do readln(a[i]);
dem1:=0;
dem2:=0;
dem3:=0;
dem4:=0;
for i:=1 to n do
begin
if (a[i]>=8) then inc(dem1);
if (6.5<=a[i]) and (a[i]<=7.9) then inc(dem2);
if (5<=a[i]) and (a[i]<=6.4) then inc(dem3);
if (a[i]<5) then inc(dem4);
end;
writeln('So hoc sinh gioi la: ',dem1);
writeln('So hoc sinh kha la: ',dem2);
writeln('So hoc sinh trung binh la: ',dem3);
writeln('So hoc sinh kem la: ',dem4);
readln;
end.