sábado, 4 de abril de 2015

Ejercicio 14



Ingresamos la cantidad de hermanos que tenemos saldrá un mensaje "NO ERES HIJO UNICO"; si la cantidad es cero el mensaje será ERES HIJO UNICO.

*/
package ejercicio.pkg14;
import java.io.*;
/**
 *
 * @author Claudia inga
 */
public class Ejercicio14 {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) throws IOException {
        // TODO code application logic here
   
    int a;
        BufferedReader in =new BufferedReader(new  InputStreamReader(System.in));
      System.out.println("ingresa la cantidad de hermanos");
      a  = Integer.parseInt(in.readLine());
     
                  if(a>0)
     System.out.println("NO ERES HIJO UNICO");  

       else

           System.out.println("ERES HIJO UNICO");
 

    }
}

No hay comentarios:

Publicar un comentario