Bạn chưa đăng nhập. Vui lòng đăng nhập để hỏi bài

Những câu hỏi liên quan
Hoàng Thị Mỹ Phan
Xem chi tiết
Dũng Nguyễn
Xem chi tiết
Nguyễn Lê Phước Thịnh
8 tháng 3 2022 lúc 6:43

#include <bits/stdc++.h>

using namespace std;

long long a,b;

int main()

{

cin>>a>>b;

cout<<min(a,b)<<" "<<max(a,b)<<endl;

cout<<max(a,b)<<" "<<min(a,b)<<endl;

return 0;

}

Jhon wisk
Xem chi tiết
Kiều Vũ Linh
25 tháng 4 2023 lúc 7:31

Var a:array[1..1000] of integer;

i,m,tam:integer;

Begin

Write('m = ');readln(m);

For i:=1 to m do

Begin

Write('Nhap so thu ',i,' = ');readln(a[i]);

End;

For i:=1 to m do

If a[i] < a[i+1] then

Begin

tam:=a[i];

a[i]:=a[i+1];

a[i+1]:=tam;

End;

Write('Mang sau khi sap xep: ');

For i:=1 to m do

Write(a[i]:8);

Readln;

End.

NguyenThiChongDinh
Xem chi tiết
Nguyễn Lê Phước Thịnh
30 tháng 4 2022 lúc 22:10

Bài 3: 

uses crt;

const fi='teptong.txt'

var a,b:integer;

f1:text;

begin

clrscr;

assign(f1,fi); rewrite(f1);

readln(a,b);

writeln(a+b);

writeln(f1,a+b);

close(f1);

readln;

end.

XTN - GAMING
Xem chi tiết
Nguyễn Lê Phước Thịnh
21 tháng 3 2022 lúc 10:19

1:

#include <bits/stdc++.h>

using namespace std;

long long a,b;

int main()

{

cin>>a>>b;

cout<<a+b;

return 0;

}

2:

#include <bits/stdc++.h>

using namespace std;

double s,r;

int main()

{

cin>>r;

s=r*r*pi;

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

return 0;

}

Hoilamgi
Xem chi tiết
Lê Trung Hiếu
Xem chi tiết
Nguyễn Lê Phước Thịnh
14 tháng 3 2022 lúc 10:25

#include <bits/stdc++.h>

using namespace std;

long long a[1000],i,n,t;

int main()

{

cin>>n;

for (i=1; i<=n; i++) cin>>a[i];

t=0;

for (i=1; i<=n; i++) t+=a[i];

cout<<t<<endl;

sort(a+1,a+n+1);

for (i=1; i<=n; i++) cout<<a[i]<<" ";

return 0;

}

Phạm Thị Đông Nhi_HDI
Xem chi tiết
shitbo
21 tháng 6 2020 lúc 16:54

program hello;

uses crt;

Var n,i,j,k: integer;

a: array[1..50] of integer;

begin;

a[1]:=k;

Readln(n);

For i:=1 to n do

Begin;

Writeln('nhap a[',i,'] '); Readln(a[i]);

End;

For i:=1 to n-1 do

For j:=i+1 to n do

If a[i]<a[j] then k:=a[j];

Writeln('gia tri lon nhat la', k);

end.

Khách vãng lai đã xóa
Đoàn Khánh Chi
Xem chi tiết
Đỗ Thanh Tuyến
6 tháng 5 2021 lúc 23:54

1. uses crt;
var a,vt:array[1..100]of integer;
n,i,t,dem:integer;
begin
clrscr;
write('Nhap n='); readln(n);
for i:=1 to n do
begin
repeat
write('A[',i,']='); readln(a[i]);
until a[i]>=0;
end;
t:=0;
for i:=1 to n do
begin
if t<100 then
begin
t:=t+a[i];
dem:=dem+1;
vt[dem]:=i;
end;
end;
writeln(vt[dem]);
readln;
end.

Nguyễn Lê Phước Thịnh
7 tháng 5 2021 lúc 21:19

Câu 2: 

uses crt;

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

i,n,kt:integer;

begin

clrscr;

write('Nhap n='); readln(n);

for i:=1 to n do 

  begin

write('A[',i,']='); readln(a[i]);

end;

kt:=0;

for i:=1 to n-1 do 

if a[i]>=a[j] then kt:=1;

if kt=0 then writeln('Day la day so khong giam')

else writeln('Day khong la day so khong giam');

readln;

end.

võ nguyên đức anh
12 tháng 4 2023 lúc 20:27

hi