Những câu hỏi liên quan
Linh Linh
Xem chi tiết
Dương Ngọc Nguyễn
9 tháng 5 2021 lúc 22:12

program mang;
uses crt;
var n,i,chan, le,max,min: Integer;
a:array[1..100] of integer;
begin
write('nhap so phan tu ');read(n);
for i:=1 to n do
begin
write('nhap so thu ',i); readln(a[i]);
end;
max:=a[1]; min:=a[1]; chan:=0;le:=0;
for i:=1to n do
begin
if a[i] > max then max:=a[i];
if a[i] < min then min:=a[i];
if a[i] mod 2 = 0 then chan:=chan+1
else le:=le+1;
end;
writeln('max la: ',max);
writeln('min la: ',min);
writeln('so phan tu chan: ',chan);
writeln('so phan tu le: ',le);
readln
end.

Bình luận (0)
User
Xem chi tiết
Nguyễn Lê Phước Thịnh
8 tháng 11 2021 lúc 23:27

Đề thiếu rồi bạn

Bình luận (0)
xmisiucute
Xem chi tiết
Nguyễn Lê Phước Thịnh
18 tháng 3 2022 lúc 9:11

uses crt;

var n,i,s:integer;

begin

clrscr;

n:=1;

s:=0;

repeat

s:=s+n;

n:=n+1;

until s>1000;

writeln(n);

readln;

end.

Bình luận (0)
Phạm Minh
Xem chi tiết
Trần Nam Khánh
19 tháng 5 2021 lúc 15:51

uses crt;
Var a:array[1..100000] of longint;
i,n,max:longint;
Begin
clrscr;
write('Nhap n: '); readln(n);
For i:=1 to n do
Begin
Write('A[',i,'] = '); Readln(A[i]);
end;
for i:=1 to n do
if a[i]>max then max:=a[i];
write('Gia tri lon nhat trong day so vua nhap la: ',max);
readln
end.

Bình luận (0)
nuinuini
Xem chi tiết
Nguyễn Lê Phước Thịnh
18 tháng 10 2021 lúc 0:11

Câu 3: 

#include <bits/stdc++.h>

using namepsace std;

double a,b,c,p,s;

int main()

{

cin>>a>>b>>c;

p=(a+b+c)/2;

s=sqrt(p*(p-a)*(p-b)*(p-c));

cout<<fixed<<setprecision(2)<<s;

return 0;

}

Bình luận (0)
nuinuini
Xem chi tiết
Nguyễn Lê Phước Thịnh
18 tháng 10 2021 lúc 0:10

Câu 3: 

#include <bits/stdc++.h>

using namepsace std;

double a,b,c,p,s;

int main()

{

cin>>a>>b>>c;

p=(a+b+c)/2;

s=sqrt(p*(p-a)*(p-b)*(p-c));

cout<<fixed<<setprecision(2)<<s;

return 0;

}

Bình luận (0)
nuinuini
Xem chi tiết
Nguyễn Lê Phước Thịnh
18 tháng 10 2021 lúc 0:11

Câu 3:

#include <bits/stdc++.h>

using namepsace std;

double a,b,c,p,s;

int main()

{

cin>>a>>b>>c;

p=(a+b+c)/2;

s=sqrt(p*(p-a)*(p-b)*(p-c));

cout<<fixed<<setprecision(2)<<s;

return 0;

}

Bình luận (0)
Nguyễn Hoài Thu
Xem chi tiết
Nguyễn Lê Phước Thịnh
9 tháng 5 2021 lúc 20:20

uses crt;

var a:array[1..100]of integer;

i,n,max,min: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];

min:=a[1];

for i:=1 to n do 

  begin

if max<a[i] then max:=a[i];

if min>a[i] then min:=a[i];

end;

writeln('Gia tri lon nhat la: ',max);

writeln('Gia tri nho nhat la: ',min);

readln;

end.

Bình luận (0)
bao gia
Xem chi tiết
Phía sau một cô gái
22 tháng 3 2023 lúc 19:38

a = int(input("Nhập chiều dài: "))

b = int(input("Nhập chiều rộng: "))

chu_vi = 2*(a+b)

dien_tich = a*b

print(f"Chu vi hình chữ nhật là: {chu_vi}")

print(f"Diện tích hình chữ nhật là: {dien_tich}")

Bình luận (0)