package Solve; import java.util.Scanner; public class Solve { static Scanner scan = new Scanner(System.in); public static void main(String[] args) { int[] num = { 100,40,60,87,34,11,56,0}; BubbleSort(num); for (int x:num) { System.out.print(x + "\t"); } } static void BubbleSort(int[] arr) { for ( int i = 0; i < arr.length; ++i) { for (int j = 0; j < arr.length - i - 1; ++j) { if ( arr[j] > arr[j + 1]) { int t = arr[j]; arr[j] = arr[j+ 1]; arr[j + 1] = t; } } } } }