14.
-
import [Link];
public class HoraDelSiguienteSegundo {
/**
* h : horas
* m : minutos
* s : segundos
*/
public static void main(String[] args) {
Scanner leer = new Scanner([Link]);
int h, m, s;
[Link]("Ingese horas: ");
h = [Link]();
[Link]("Ingese minutos: ");
m = [Link]();
[Link]("Ingese segundo: ");
s = [Link]();
s = s+1;
if(s == 60)
{
s = 0;
m = m+1;
if(m == 60)
{
m = 0;
h = h+1;
if(h==24)
{
h=0;
}
}
}
[Link]("Horas correspondiente al siguiente segundo:
"+h+":"+m+":"+s);
}
}