All pastes #542850 Raw Edit

Stuff

public text v1 · immutable
·published 2007-06-05 23:06 UTC
rendered paste body
System.out.print( "Dwse akeraio GAY: " );

String input = stdin.readLine();

try {
	int x = Integer.parseInt( input );
}
catch ( NumberFormatException e ) {
	System.out.println( e.getMessage() + " mpravo malaka, aftos den einai akeraios." );
}

// den 3erw ti kaneis edw, an thes to vlepoume. mporeis eite na termatiseis eite na 3anazitiseis ton 1o akeraio

System.out.print( "Dwse allon enan: " );

input = stdin.readLine();

try {
	int y = Integer.parseInt( input );
}
catch ( NumberFormatException e ) {
	System.out.println( e.getMessage() + " mpravo malaka, aftos den einai akeraios." );
}

// omoiws

try {
	float result = y/x;
	System.out.println("apotelesma: " + result);
}
catch (ArithmeticException e) {
	System.out.println( e.getMessage() + " o diairetis einai 0, ZWO." );
}

// omoiws