package bubble;
import java.util.Scanner;
import java.io.File;
import java.io.FileNotFoundException;
public class Bubble {
public static void main(String []args) throws FileNotFoundException{
System.out.println("Reading file ...");
int[] a = {1,2,3,4,5,6,7,8,9,10,5,6,3,7,1};
String fn = "/home/hlavavla/11.txt";
File ff = new File(fn);
Scanner sc2 = new Scanner(ff);
for (int i=0; i<10; i++)
{ a[i]=sc2.nextInt();}
for (int i=0; i<10; i++)
{ System.out.print(a[i]+", ");}
System.out.println();
int c=0;
for (int j=9; j>=0; j--){
for (int i=0; i<j; i++)
{ if (a[i]>a[i+1]) {
c = a[i];
a[i]=a[i+1];
a[i+1]=c;
System.out.print(".");
} } }
System.out.println();
for (int i=0; i<10; i++)
{ System.out.print(a[i]+", ");}
System.out.println();
}
}