10.-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