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 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.
a:array[1..200] of real;
begin
clrscr;
write('Nhap tong so ban trong lop:');
readln(n);
for i:=1 to n do readln(a[i]);
gioi:=0; kha:=0; kem:=0;
for i:=1 to n do
begin
if (a[i]>=8) then inc(gioi);
if (6.5<=a[i]) and (a[i]<=7.9) then inc(kha);
if (a[i]<6.5) then inc(kem);
end;
writeln('So hoc sinh gioi la:',gioi);
writeln('So hoc sinh kha la:',kha);
writeln('So hoc sinh kem la:',kem);
readln;
end.
program b1;
uses crt;
var i,n,dat,chuadat:integer;
a:array[1..100] of integer;
begin
clrscr;
write('Nhap tong so ban trong lop:');
readln(n);
for i:=1 to n do readln(a[i]);
dat:=0; chuadat:=0;
for i:=1 to n do
begin
if (a[i]>=5) then inc(dat);
if (5>=a[i]) then inc(chuadat);
end;
writeln('So hoc sinh dat la:',dat);
writeln('So hoc sinh chuadat la:',chuadat);
readln;
end.
Tham khao!
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.
Tham khảo
program oken;
uses crt;
var a: array [1..100] of real;
i,n,dy,dtb,dk,dg:integer;
begin
clrscr;
write('Co bao nhieu ban can nhap diem: '); readln(N);
for i:=1 to n do
begin
write('nhap diem ban thu ',i,': ');
readln(a[i]);
if a[i]<5 then
dy:=dy+1
else if a[i]<6.4 then
dtb:=dtb+1
else if a[i]<7.9 then
dk:=dk+1
else
dg:=dg+1;
end;
writeln('So ban hoc yeu: ',dy);
writeln('So ban hoc trung binh: ',dtb);
writeln('So ban hoc kha: ',dk);
writeln('so ban hoc gioi: ',dg);
readln;
end.
program Phanloai;
uses crt;
Var i, n, Gioi, Kha, Trungbinh, Kem: integer;
A: array[1..100] of real;
Begin
clrscr;
write('Nhap so cac ban trong lop, n = '); readln(n);
writeln('Nhap diem:');
For i:=1 to n do Begin write(i,'.'); readln(a[i]); End;
Gioi:=0; Kha:=0; Trungbinh:=0; Kem:=0;
for i:=1 to n do
begin
if a[i]>=8.0 then Gioi:=Gioi+1;
if a[i]<5 then Kem:=Kem+1;
if (a[i]<8.0) and (a[i]>=6.5) then Kha:=Kha+1;
if (a[i]>=5) and (a[i]<6.5) then Trungbinh:=trungbinh+1
end;
writeln('Ket qua hoc tap:');
writeln(Gioi,' ban hoc gioi');
writeln(Kha,' ban hoc kha');
writeln(Trungbinh,' ban hoc trung binh');
writeln(Kem,' ban hoc kem');
readln
End.
uses crt;
var a:array[1..100]of real;
n,i,dem:integer;
begin
clrscr;
readln(n);
for i:=1 to n do readln(a[i]);
dem:=0;
for i:=1 to n do
if a[i]>=8 then dem:=dem+1;
for i:=1 to n do
if a[i]>=8 then write(a[i]:4:2,' ');
writeln;
writeln(dem);
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
#include <bits/stdc++.h>
using namespace std;
double a[100],b[100],c[100],tb[100];
int n,i;
int main()
{
cin>>n;
for (i=1; i<=n; i++) cin>>a[i]>>b[i]>>c[i];
for (i=1; i<=n; i++)
tb[i]=(a[i]+b[i]+c[i])/3;
for (i=1; i<=n; i++)
cout<<"Diem cua ban thu "<<i<<" la: "<<fixed<<setprecision(2)<<tb[i]<<endl;
return 0;
}