martes, 21 de abril de 2015

e_10


package ejercicio10;

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

public class EJERCICIO10 {

    public static void main(String[] args) throws IOException {
        // TODO code application logic here
     int HORA=3600;
     int MINUTO=60;
   
     int t,h,m,s;
        BufferedReader in=new BufferedReader(new  InputStreamReader(System.in));
 System.out.println("Tiempo en segundos: ");
 t=(int)Integer.parseInt(in.readLine());//ojo
 h=t / HORA;
 t=t % HORA;
 m=t / MINUTO;
 s=t % MINUTO;
 System.out.println("");
 System.out.println("Horas:" + h);
  System.out.println("Minutos:" + m);
   System.out.println("Segundos:" + s);
 System.out.println();
     
    }
}

No hay comentarios:

Publicar un comentario