Está en la página 1de 1

package entrega1;

import java.util.Scanner;
public class segundos {
public static void main(String[]args){

Scanner entrada = new Scanner(System.in);

int horas, minutos, segundos, totalsegundos;

System.out.print( "Ingrese la hora: " );


horas = entrada.nextInt();

System.out.print( "Ingrese los minutos: " );


minutos = entrada.nextInt();

System.out.print( "Ingrese los segundos " );


segundos = entrada.nextInt();

totalsegundos = (horas*3600)+(minutos*60)+segundos;

System.out.println("el total de segundos transcurridos es de " + totalsegundos);


}
}

También podría gustarte