martes, 21 de abril de 2015

e_21



package ejercicio21;

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

public class EJERCICIO21 {

    public static void main(String[] args) throws IOException {
       int t;
       String c;
 BufferedReader in=new BufferedReader(new  InputStreamReader(System.in));
 System.out.println("Numero: ");
 t=Integer.parseInt(in.readLine());//ojo
 if (t<10)
 {
     c="FRIO";
 }
 else
 {
     if (t>10 && t <=20)
     {
         c="NUBLADO";
     }
     else
     {
         if (t>=21 && t<=30)
         {
             c="CALOR";
         }
         else
         {
             c="TROPICAL";
         }
     }
 }
       System.out.println("");
       System.out.println("Clima:" + c);
       System.out.println();
    }
}

No hay comentarios:

Publicar un comentario