forked from bliblidotcom/training-java-future-program
- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathArraysort.java
More file actions
Latest commit
21 lines (20 loc) · 446 Bytes
/
Copy pathArraysort.java
File metadata and controls
21 lines (20 loc) · 446 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
publicclassArraysort {
publicstaticvoidmain(String[] args) {
int[] array = newint[args.length];
for(inti=0;i<args.length;i++){
array[i]=Integer.parseInt(args[i]);
}
for(inti=0;i<array.length;i++){
for(intj=i+1;j<array.length;j++){
if(array[i]>array[j]){
inttemp=array[i];
array[i]=array[j];
array[j]=temp;
}
}
}
for(inti=0;i<array.length;i++){
System.out.print(array[i]+ " ");
}
}
}