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,b,c:integer;
begin
clrscr;
readln(a,b,c);
a:=sqr(a);
b:=sqr(b);
c:=sqr(c);
writeln((a+b+c)/3:4:2);
readln;
end.
Var a:array[1..20] of integer;
max,min:integer;
tbc:real;
Begin
For i:=1 to 20 do
Begin
Write('Nhap so thu ',i,' = ');readln(a[i]);
End;
Max:=a[1];
Min:=a[1];
For i:=2 to 20 do
Begin
If a[i] > max then max:=a[i];
If a[i] < min then min:=a[i];
End;
tbc:=(max+min)/2;
Writeln('So lon nhat la ',max);
Writeln('So nho nhat la ',min);
Write('Trung binh cong la ',tbc:10:2);
Readln;
End.
Var a:array[1..20] of integer;
max,min:integer;
tbc:real;
Begin
For i:=1 to 20 do
Begin
Write('Nhap so thu ',i,' = ');readln(a[i]);
End;
Max:=a[1];
Min:=a[1];
For i:=2 to 20 do
Begin
If a[i] > max then max:=a[i];
If a[i] < min then min:=a[i];
End;
tbc:=(max+min)/2;
Writeln('So lon nhat la ',max);
Writeln('So nho nhat la ',min);
Write('Trung binh cong la ',tbc:10:2);
Readln;
End.
Câu 2:
uses crt;
var a:array[1..100]of integer;
i,n,tb:integer;
begin
clrscr;
write('Nhap n='); readln(n);
for i:=1 to n do
begin
write('A[',i,']='); readln(a[i]);
end;
tb:=0;
for i:=1 to n do
tb:=tb+a[i];
writeln(tb/n:4:2);
readln;
end.
Câu 1:
#include <bits/stdc++.h>
using namespace std;
double a,b,c;
int main()
{
cin>>a>>b>>c;
cout<<fixed<<setprecision(2)<<(a+b+c)/3;
return 0;
}
uses crt;
var a,b:integer;
begin
clrscr;
readln(a,b);
writeln('Tong hai so la: ',a+b);
writeln('Tong binh phuong hai so la: ',sqr(a)+sqr(b));
readln;
end.
#include <bits/stdc++.h>
using namespace std;
double a,b,c,d,tb;
int main()
{
cin>>a>>b>>c>>d;
if (a>0 && b>0 && c>0 && d>0) cout<<fixed<<setprecision(2)<<(a+b+c+d)/4;
else cout<<"Day khong phai bon so cung duong";
return 0;
}
program trungbinh;
uses crt;
var n,i: integer;
s:real;
A: array[1..1000] of integer;
begin
clrscr;
write('Nhap do dai day: '); readln(n);
writeln('Nhap gia tri cua day: ');
S:=0;
for i:=1 to n do
begin
write('A[',i,']= ');
readln(A[i]);
S:=S+A[i];
end;
S:=S/n;
write('Trung binh cua cac so cua day do la: ',S);
readln;
end.
a)
uses crt;
var a:array[1..100]of integer;
i,n,max:integer;
begin
clrscr;
write('Nhap n='); readln(n);
for i:=1 to n do
begin
write('A[',i,']='); readln(a[i]);
end;
max:=a[1];
for i:=1 to n do
if max<a[i] then max:=a[i];
writeln(max);
readln;
end.
b)
uses crt;
var a:array[1..100]of integer;
i,n,min:integer;
begin
clrscr;
write('Nhap n='); readln(n);
for i:=1 to n do
begin
write('A[',i,']='); readln(a[i]);
end;
min:=a[1];
for i:=1 to n do
if min>a[i] then min:=a[i];
writeln(min);
readln;
end.
uses crt;
var
a,b,c,s:integer;
begin
readln(a,b,c);
s:=(a+b+c)/3;
writeln('TBC 3 so a,b,c la: ',s);
readln
end.