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.
#include <bits/stdc++.h>
using namespace std;
long long a,b;
int main()
{
cin>>a>>b;
cout<<min(a,b)<<" "<<max(a,b);
return 0;
}
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.
#include <bits/stdc++.h>
using namespace std;
int A[1000],n,i;
int main()
{
cin>>n;
for (int i=1; i<=n; i++) cin>>A[i];
sort(A+1,A+n+1);
for (int i=1; i<=n; i++)
cout<<A[i]<<" ";
cout<<endl;
for (int i=2; i<=n; i++)
cout<<A[i]-A[i-1]<<endl;
return 0;
}
1)
Var array:[1..1000] of integer;
i,n,t:integer;
Begin
Write('n = ');readln(n);
For i:=1 to n do
Begin
Write('Nhap so thu ',i,' = ');readln(a[i]);
End;
For i:=1 to n do
If a[i] > a[i+1] then
Begin
t:=a[i];
a[i]:=a[i+1];
a[i+1]:=t;
End;
Write('Sap xep tang dan ');
For i:=1 to n do write(a[i]:8);
Readln
End.
2)
Var array:[1..1000] of integer;
i,n,t:integer;
Begin
Write('n = ');readln(n);
For i:=1 to n do
Begin
Write('Nhap so thu ',i,' = ');readln(a[i]);
End;
For i:=1 to n do
If a[i] < a[i+1] then
Begin
t:=a[i];
a[i]:=a[i+1];
a[i+1]:=t;
End;
Write('Sap xep giam dan ');
For i:=1 to n do write(a[i]:8);
Readln
End.
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;
long long a,b;
int main()
{
cin>>a>>b;
cout<<a+b<<endl;
cout<<a-b;
return 0;
}
#include <bits/stdc++.h>
using namespace std;
long long a,b;
int main()
{
cin>>a>>b;
cout<<max(a,b);
return 0;
}
#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;
}