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.
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 a:array[1..100]of real;
i,n:integer;
ln:real;
begin
clrscr;
readln(n);
for i:=1 to n do readln(a[i]);
ln:=0;
for i:=1 to n do if ln<a[i] then ln:=a[i];
writeln(ln:4:2);
readln;
end.
Var a:array[1..35] of real;
i:integer;
Begin
For i:=1 to 35 do
Begin
Write('Nhap diem thu ',i);readln(a[i]);
End;
write('Diem vua nhap la ');
For i:=1 to 35 do write(a[i]:10:2);
Writeln;
write('Cac diem duoi 5 hoac > la ');
For i:=1 to 35 do
If (a[i]>9) or (a[i]<5) then write(a[i]:10:2)
Readln
End.
uses crt;
var a:array[1..100]of real;
i,n:integer;
ln:real;
begin
clrscr;
readln(n);
for i:=1 to n do readln(a[i]);
for i:=1 to n do writeln(a[i]);
ln:=a[1];
for i:=1 to n do if ln<a[i] then ln:=a[i];
writeln(ln);
readln;
end.
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.
uses crt;
var ten:array[1..50]of string;
diem:array[1..50]of integer;
i,n,max:integer;
begin
clrscr;
write('Nhap so hoc sinh:'); readln(n);
for i:=1 to n do
begin
write('Ten cua hoc sinh thu ',i,' la: '); readln(ten[i]);
write('Diem cua hoc sinh thu ',i,' la: '); readln(diem[i]);
end;
max:=0;
for i:=1 to n do
if max<diem[i] then max:=diem[i];
writeln('Diem cao nhat la: ',max);
for i:=1 to n do
if diem[i]=max then writeln(ten[i]);
readln;
end.
uses crt;
var a,b,c,tb:array[1..10]of real;
ln,nn:real;
n:integer;
i:integer;
begin
clrscr;
readln(n);
for i:=1 to n do readln(a[i],b[i],c[i]);
for i:=1 to n do
tb[i]:=(a[i]+b[i]+c[i])/3;
for i:=1 to n do
writeln(tb[i]:4:2);
readln;
end.
#include <bits/stdc++.h>
using namespace std;
double a[100];
int n,i;
int main()
{
cin>>n;
for (i=1; i<=n; i++) cin>>a[i];
for (i=1; i<=n; i++)
if (a[i]>=1.5) cout<<fixed<<setprecision(2)<<a[i]<<" ";
return 0;
}