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;
n,i:integer;
kq:real;
begin
clrscr;
write('Nhap so ban hoc sinh:'); readln(n);
for i:=1 to n do
begin
write('Nhap can nang cua ban thu ',i,'='); readln(a[i]);
end;
kq:=0;
for i:=1 to n do
kq:=kq+a[i];
writeln('Can nang trung binh cua lop la: ',kq/n:4:2);
readln;
end.
uses crt;
const n=10;
var diem:array[1..n]of real;
i,dem,dem1:integer;
t,tbc:real;
begin
clrscr;
for i:=1 to n do
begin
write('diem[',i,']='); readln(diem[i]);
end;
{-----------------------tinh-tong-diem-cua-10-hoc-sinh---------------------------------}
t:=0;
for i:=1 to n do
t:=t+diem[i];
writeln('tong diem cua 10 hoc sinh la: ',t:4:2);
{----------------------tinh-diem-tbinh-cua-10-hoc-sinh---------------------------------}
tbc:=t/n;
writeln('diem trung binh cua 10 hoc sinh la: ',tbc:4:2);
{---------------------dem-so-hoc-sinh-co-diem>5---------------------------------------}
dem:=0;
for i:=1 to n do
if diem[i]>5 then inc(dem);
writeln('so hoc sinh co diem lon hon 5 la: ',dem);
{---------------------dem-so-hoc-sinh-gioi--------------------------------------------}
dem1:=0;
for i:=1 to n do
if diem[i]>=8 then inc(dem1);
writeln('so hoc sinh gioi la: ',dem1);
readln;
end.
uses crt;
var st:string;
a:array[1..255]of string;
i,n,d,kt,j,dem,dem1,dem2:integer;
begin
clrscr;
readln(st);
d:=length(st);
dem:=1;
a[1]:=st[1];
for i:=1 to d do
begin
kt:=0;
for j:=1 to dem do
if a[j]=st[i] then kt:=1;
if kt=0 then
begin
dem:=dem+1;
a[dem]:=st[i];
end;
end;
dem1:=0;
dem2:=0;
for i:=1 to dem do
begin
if st[i] in ['A'..'Z'] then dem1:=dem1+1;
if st[i] in ['a'..'z'] then inc(dem1);
if st[i] in ['0'..'9'] then inc(dem2);
end;
writeln(dem1);
writeln(dem2);
readln;
end.
a:
#include <bits/stdc++.h>
using namespace std;
double tbc,x;
long long n,i;
int main()
{
cin>>n;
tbc=0;
for (i=1; i<=n; i++)
{
cin>>x;
tbc=tbc+x;
}
cout<<fixed<<setprecision(2)<<tbc/(n*1.0);
return 0;
}
uses crt;
var i,n,dem:integer;
a:array[1..100]of real;
begin
clrscr;
write('Nhap so hoc sinh:'); readln(n);
for i:=1 to n do
begin
repeat
write('Nhap diem trung binh mon Tin Hoc cua ban thu ',i,'='); readln(a[i]);
until (0<a[i]) and (a[i]<=10);
end;
dem:=0;
for i:=1 to n do
if a[i]>=5 then inc(dem);
writeln('So ban co diem tren trung binh la: ',dem);
readln;
end.
Bài 1:
Program hotrotinhoc;
var i,n: integer;
t: longint;
begin
write('n='); readln(n);
for i:=1 to n do
begin
write('a[',i,']='); readln(a[i]);
end;
for i:=1 to n do
begin
write(a[i],' ');
if a[i] mod 2=1 then t:=t+a[i];
end;
writeln;
write(t);
readln
end.
Bài 2:
Program hotrotinhoc;
var i,n,t: integer;
begin
write('n='); readln(n);
for i:=1 to n do
begin
write('Nhap diem Toan cua ban thu ',i,': '); readln(a[i]);
end;
for i:=1 to n do
begin
writeln('Diem toan cua ban thu ',i,' la :',a[i]);
if a[i] >=8 then t:=t+1;
end;
write('So hoc sinh co diem toan la 8 tro len la :', t);
readln
end.
Bài 3:
Program hotrotinhoc;
var i,n,k: integer;
a:array[1..32000] of string;
begin
write('Nhap k='); readln(k);
write('Nhap n='); readln(n);
for i:=1 to n do
begin
write('a[',i,']='); readln(a[i]);
end;
a[k]:='NO';
for i:=1 to n do
if a[i]<>'NO' then write(a[i],' ');
readln
end.
Bài 4:
Program hotrotinhoc;
var min,i,n,vt: integer;
a:array[1..32000] of integer;
begin
write('Nhap n='); readln(n);
for i:=1 to n do
begin
write('a[',i,']='); readln(a[i]);
end;
min:=32000;
for i:=1 to n do
if a[i]<min then
begin
min:=a[i];
vt:=i;
end;
write('So nho nhat trong day la so thu ',vt);
readln
end.
Program hotrotinhoc_hoc24;
var a: array[1..100] of real;
i,n,d: ineteger;
begin
write('Nhap so ban hoc sinh lop 11: '); readln(n);
d:=0;
for i:=1 to n do
begin
write('Nhap can nang ban thu ',i,' : '); readln(a[i]);
if a[i]>50 then inc(d);
end;
write('Co ',d,' ban co can nang lon hon 50kg');
readln
end.
Thanks you so much