package Test;
import java.util.Random;
public class MainTest {
public static void main(String[] args) {
int arr[] = new int[50];
Random random = new Random();
for(int i = 0; i < 50; i++){
arr[i] = random.nextInt(50);
//System.out.print(arr[i]+",");
}
for(int i = 1; i <= arr.length; i++){
for(int j =0;j < arr.length-1; j++){
if(arr[j]>arr[j+1]){
int a = arr[j];
arr[j] = arr[j+1];
arr[j+1] = a;
}
}
}
for(int i = 0; i < arr.length; i++){
System.out.println(arr[i]+",");
}
}
}
import java.util.Random;
public class MainTest {
public static void main(String[] args) {
int arr[] = new int[50];
Random random = new Random();
for(int i = 0; i < 50; i++){
arr[i] = random.nextInt(50);
//System.out.print(arr[i]+",");
}
for(int i = 1; i <= arr.length; i++){
for(int j =0;j < arr.length-1; j++){
if(arr[j]>arr[j+1]){
int a = arr[j];
arr[j] = arr[j+1];
arr[j+1] = a;
}
}
}
for(int i = 0; i < arr.length; i++){
System.out.println(arr[i]+",");
}
}
}