Sort

    0

    0

    Soso Geguchadze

    The code uses the namespace std to declare a variable called n and an array named a. Then, the code assigns values to the n and a variables. Next, the code uses the for loop to repeat the following code nine times. Finally, the code prints out the contents of the a array.

    #include<bits/stdc++.h>
    
    using namespace std;
    
    int main(){
      int n;cin>>n;
      int a[n];
      for(int k=0;k<n;k++){
        cin>>a[k];
        }
      sort(a,a+n);
      for(int k=0;k<n;k++){
        cout<<a[k];
        }
      return 0;
    }
    Codiga Logo
    Codiga Hub
    • Rulesets
    • Playground
    • Snippets
    • Cookbooks
    soc-2 icon

    We are SOC-2 Compliance Certified

    G2 high performer medal

    Codiga – All rights reserved 2022.