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 n,a[1000001];
int main()
{
cin>>n;
for(int i=1;i<=n*2;i++)
{
cin>>a[i];
}
sort(a+1,a+n+1);
sort(a+n+1,a+2*n+1,greater<long long>());
for(int i=1;i<=n*2;i++)
{
cout<<a[i]<<" ";
}
return 0;
}
Program hotrotinhoc;
var a,b,i: word;
function nt(x: word) : boolean;
var j: integer;
begin
nt:=true;
if (x=2) or (x=3) then exit;
nt:=false;
if (x=1) or (x mod 2=0) or (x mod 3=0) then exit;
j:=6;
while j<=trunc(sqrt(x)) do
begin
if (x mod j=0) or (x mod (j+2)=0) then exit;
i:=i+5;
end;
nt:=true;
end;
begin
readln(a,b);
for i:=a to b do if nt(i) then writeln(i);
readln
end.
uses crt;
var a,b,kt,i,j:integer;
begin
clrscr;
write('nhap a='); readln(a);
write('nhap b='); readln(b);
if a<b then
begin
for i:=a to b do
begin
kt:=0;
for j:=2 to i-1 do
if i mod j=0 then kt:=1;
if kt=0 then writeln(i);
end;
end;
readln;
end.
uses crt;
var a,b,c,d:array[1..100]of integer;
n,i,dem,dem1,dem2:integer;
begin
clrscr;
write('n='); readln(n);
for i:=1 to n do
begin
write('a[',i,']='); readln(a[i]);
end;
{------------------------------xu-ly------------------------------}
dem:=0;
dem1:=0;
dem2:=0;
for i:=1 to n do
if a[i]<0 then
begin
inc(dem);
b[dem]:=a[i];
end
else if a[i]=0 then
begin
inc(dem1);
c[dem1]:=a[i];
end
else begin
inc(dem2);
d[dem2]:=a[i];
end;
for i:=1 to dem do
write(b[i]:4);
for i:=1 to dem1 do
write(c[i]:4);
for i:=1 to dem2 do
write(d[i]:4);
readln;
end.
program bai1;
var
begin
write('Ten cua ban la ');readln(ten);
write('Nam hien tai la ');readln(nht);
write('Nhap nam sinh ');readln(ns);
write('Ban hoc lop ');readln(lop);
tuoi:=nht-ns;
writeln('Ten cua ban la ',tuoi);
readln
end.
#include<iostream>
using namespace std;
int main() {
int a,b;
cin >> a >> b;
cout << (a+b)*2;
return 0;
}
#include <bits/stdc++.h>
using namespace std;
long long n,a[1000001];
int main()
{
cin>>n;
for(int i=1;i<=n*2;i++)
{
cin>>a[i];
}
sort(a+1,a+n+1);
sort(a+n+1,a+2*n+1,greater<long long>());
for(int i=1;i<=n*2;i++)
{
cout<<a[i]<<" ";
}
return 0;
}