UNA HERMOSA MOTO

UNA HERMOSA MOTO

miércoles, 22 de abril de 2015

Problema Resuelto 10


10.-CONVERTIR SEGUNDOS EN HORAS Y MINUTOS


Resultado de imagen para CONVERTIR SEGUNDOS EN HORAS Y MINUTOS

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

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

No hay comentarios:

Publicar un comentario