-
Notifications
You must be signed in to change notification settings - Fork 0
/
TurboSort.java~
26 lines (26 loc) · 914 Bytes
/
TurboSort.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
import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
public class Main
{
public static BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
public static void main(String []args) throws IOException
{
int size;
long array[];
size=Integer.parseInt(in.readLine());
array=new long[size];
for(int index=0;index<size;index++)
array[index]=Long.parseLong(in.readLine());
for(int index=0;index<size-1;index++)
for(int pointer=index+1;pointer<size;pointer++)
if(array[index]>array[pointer])
{
long temp=array[index];
array[index]=array[pointer];
array[pointer]=temp;
}
for(int index=0;index<size;index++)
System.out.println(array[index]);
}
}