import Supporting.*;

// Test program to read ints from the terminal (one per line)
// sort them, and then output them.

public class SortInts
{
    public static void main( String [ ] args )
    {
            // Read an array of int
        int [ ] arr = ReadInts.getInts( ); // Figure 1.10

            // Convert to an array of MyInteger
        MyInteger [ ] theArray = new MyInteger[ arr.length ];
        for( int i = 0; i < theArray.length; i++ )
            theArray[ i ] = new MyInteger( arr[ i ] );

            // Apply the sorting method
        DataStructures.Sort.insertionSort( theArray );

            // Output sorted result
        System.out.println( "Sorted result: " );
        for( int i = 0; i < theArray.length; i++ )
            System.out.println( theArray[ i ] );
     }
}