forked from bliblidotcom/training-java-future-program
- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsort.java
More file actions
Latest commit
29 lines (28 loc) · 448 Bytes
/
Copy pathsort.java
File metadata and controls
29 lines (28 loc) · 448 Bytes
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
publicclasssort{
publicstaticvoidmain(String[] args)
{
intlen = args.length;
int[] arr;
arr = newint[len];
for(inti=0; i<len;i++)
{
arr[i] = Integer.parseInt(args[i]);
}
for(inti=0;i<len;i++)
{
inttemp = 0;
for(intj=0;j<len;j++)
{
if(arr[i] > arr[j]){
temp = arr[i];
arr[i] = arr[j];
arr[j] = temp;
}
}
}
for(inti=0; i<len;i++)
{
System.out.print(arr[i]+" ");
}
}
}