UNA HERMOSA MOTO

UNA HERMOSA MOTO

miércoles, 22 de abril de 2015

Problema Resuelto 15


15.- PAR O IMPAR

Resultado de imagen para PAR O IMPAR


/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package problema015;
import java.io.*;
/**
 *
 * @author abel montalvan
 */
public class PROBLEMA015 {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) throws IOException{
        // TODO code application logic here

   int n;
   String r;
 BufferedReader in=new BufferedReader(new  InputStreamReader(System.in));
 System.out.println("Número: ");
 n=Integer.parseInt(in.readLine());
 if(n%2==0)
 {
     r= "PAR";
 }
 else
 {
     r= "IMPAR";
 }
 System.out.println("");
 System.out.println("Resultado: " + r);
 System.out.println();
 }
}

No hay comentarios:

Publicar un comentario