1 2 package leerdatos; 3 4 import java.io.*; 5 6 public class LeerDatos 7 { 8 9 public static void main(String[] args) throws IOException 10 { 11 String nombres; 12 String apellidos; 13 String Num1; 14 String Num2; 15 int N1; 16 int N2; 17 int N3; 18 19 InputStreamReader ISR = new InputStreamReader(System.in); 20 BufferedReader texto = new BufferedReader(ISR) ; 21 22 /*System.out.print("Ingrese nombres ... "); 23 nombres = texto.readLine(); 24 System.out.print("Ingrese apellidos ... "); 25 apellidos = texto.readLine(); 26 System.out.println(nombres); 27 System.out.println(apellidos); */ 28 29 /*System.out.print("Ingrese primer numero "); 30 Num1 = texto.readLine(); 31 System.out.print("Ingrese segundo numero "); 32 Num2 = texto.readLine();*/ 33 34 System.out.print("Ingrese primer numero "); 35 N1 = Integer.parseInt(texto.readLine()); 36 System.out.print("Ingrese segundo numero "); 37 N2 = Integer.parseInt(texto.readLine()); 38 39 N3 = N1 + N2; 40 41 System.out.println("La suma es "+N3); 42 43 44 } 45 }
Follow By Email
sábado, 27 de marzo de 2010
Leer Datos java
Suscribirse a:
Enviar comentarios (Atom)
No hay comentarios:
Publicar un comentario