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.
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.
#include <bits/stdc++.h>
using namespace std;
double a,b,c,tb;
int main()
{
cin>>a>>b>>c;
tb=((a+b)*2+c)/5;
if (tb>=9) cout<<"Gioi";
else if ((tb>=7) and (tb<9)) cout<<"Kha";
else if ((tb>=5) and (tb<7)) cout<<"Trung binh";
else cout<<"Yeu";
return 0;
}
#include <bits/stdc++.h>
using namespace std;
double a,b,c,tb;
int main()
{
cin>>a>>b>>c;
tb=((a+b)*2+c)/5;
if (tb>=9) cout<<"Gioi";
else if ((tb>=7) and (tb<9)) cout<<"Kha";
else if ((tb>=5) and (tb<7)) cout<<"Trung binh";
else cout<<"Yeu";
return 0;
}
Uses CRT;
Var TB : real;
BEGIN
clrscr;
repeat
begin
write('Moi ban nhap diem trung binh: ');
Readln(TB);
end;
until (TB>0) and (TB<10);
If (TB >= 8) then write('hoc luc gioi') else
If (TB>=6.5) then write('hoc luc kha') else
If (TB>5) then write('hoc luc trung binh') else
If (TB>3.5) then write('hoc luc yeu') else
write('hoc luc kem');
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.