@Darklordx/

TEMPLATE-36

Java

No description

fork
loading
Files
  • Main.java
Main.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
//TEMPLATE
import java.util.*;
import java.math.*;
public class Main {
    static Scanner scan;
    public static void println(Object s){System.out.println(s);}
    public static void print(Object s){System.out.print(s);}
    public static int nextInt(){return scan.nextInt();}
    public static long nextLong(){return scan.nextLong();}
    
    public static int nextIntL(){int i = scan.nextInt(); scan.nextLine(); return i;}
    public static long nextLongL(){long i = scan.nextLong(); scan.nextLine(); return i;}

    public static String nextLine(){return scan.nextLine();}
    
    static void printArray(int arr[]) 
    { 
        int n = arr.length; 
        for (int i=0; i<n; ++i) 
            System.out.print(arr[i]+" "); 
        System.out.println(); 
    }

    public static void main(String[] args) {scan = new Scanner(System.in);solution();}

    //Solution goes below:
    public static void solution(){
        int n = nextInt();
        int[] stuff = new int[n];
        for(int i=0;i<n;i++){
            stuff[i] = nextInt();
        }
        Arrays.sort(stuff);
        printArray(stuff);
    }

}