martes, 21 de abril de 2015

e_17


package ejercicio17;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class EJERCICIO17 {

    public static void main(String[] args) throws IOException {
        // TODO code application logic here
        int n,r;
        BufferedReader in=new BufferedReader(new  InputStreamReader(System.in));
 System.out.println("Numero: ");
 n=Integer.parseInt(in.readLine());//ojo
 if (!(n%2==0))
 {
     r=n*2;
 }
 else
 {
     r=n*3;
 }
  System.out.println("");
 System.out.println("Resultado:" + r);
 System.out.println();
  }
}

No hay comentarios:

Publicar un comentario