import java.util.Scanner;

/**
 *  A class to compare the results of truncation and rounding.
 *  Be sure to try it with both positive and negative real numbers.
 */
class TestRound
{
    public static void main(String[] args)
    {
	// Read a real number provided by the user.
	Scanner in = new Scanner(System.in);
	System.out.print("Enter a real number: ");
	double x = in.nextDouble();
	
	// Truncate
	System.out.println("(int) x             = " + (int) x );
	// Add 0.5 and truncate
	System.out.println("(int) (x + 0.5)     = " + (int)(x + 0.5));
	// Round
	System.out.println("(int) Math.round(x) = " + (int) Math.round(x));
    }
}


