Created
October 22, 2013 21:38
-
-
Save IsaacGonzalez/7108638 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.io.BufferedReader; | |
import java.io.IOException; | |
import java.io.InputStreamReader; | |
import java.util.logging.Level; | |
import java.util.logging.Logger; | |
public class JavaApplication1 { | |
public static void main(String[] args) { | |
InputStreamReader isr = new InputStreamReader(System.in); | |
BufferedReader br = new BufferedReader(isr); | |
try { | |
System.out.println("Inserte el primer numero:"); | |
int num1 = Integer.parseInt(br.readLine()); | |
System.out.println("Inserte el segundo numero:"); | |
int num2 = Integer.parseInt(br.readLine()); | |
if(num2 > num1){ | |
int numeroAuxiliar = num1; | |
num1 = num2; | |
num2 = numeroAuxiliar; | |
} | |
System.out.println("Numero 1: " + num1); | |
System.out.println("Numero 2: " + num2); | |
} catch (IOException ex) { | |
Logger.getLogger(JavaApplication1.class.getName()).log(Level.SEVERE, null, ex); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment