Competitive Programming Solutions

GitHub
back to dashboard

T. Sort Numbers

Codeforces - Sheet #1 (Data type - Conditions) · limit: 0.25s · memory: 256MB · view on codeforces

input

2
3 -2 1
373644 373644 454379

output

-2
1
3

3
-2
1
373644
373644
454379

373644
373644
454379
Main.java
static void solve() {
        int a = in.nextInt();
        int b = in.nextInt();
        int c = in.nextInt();
        int[] arr = {a, b, c};
        Arrays.sort(arr);
        out.println(arr[0]);
        out.println(arr[1]);
        out.println(arr[2]);
        out.println();
        out.println(a);
        out.println(b);
        out.println(c);
    }