Algorithm
Code Examples
#1 Code Example with C++ Programming
Code -
C++ Programming
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define endl '\n'
#define debug(n) cout<<(n)<<endl;
const ll INF = 2e18 + 99;
int main(){
ios_base::sync_with_stdio(false);
cin.tie(NULL);
ll n;
cin>>n;
ll arr[n];
for(ll i = 0; i < n; i++){
cin>>arr[i];
}
sort(arr, arr+n);
for(auto i : arr){
cout<<i<<" ";
}
cout<<endl;
}
Copy The Code &
Try With Live Editor
Input
4
3 2 1 2
3 2 1 2
Output
1 2 2 3
Demonstration
Codeforcess Solution 405-A A. Gravity Flip ,C++, Java, Js and Python ,405-A,Codeforcess Solution