/* package whatever; // don't place package name! */
import java.util.* ;
import java.lang.* ;
import java.io.* ;
/* Name of the class has to be "Main" only if the class is public. */
class Ideone
{
int horaAtual
= Integer .
parseInt ( atual
) ;
int horarioAberto
= Integer .
parseInt ( abertura
) ; int horarioFechado
= Integer .
parseInt ( fecho
) ;
if ( horarioAberto < horarioFechado) { //horario normal
if ( horaAtual < horarioAberto || horaAtual > horarioFechado) {
return "FECHADO" ;
}
else {
return "ABERTO" ;
}
}
else { //horario que passa o dia
if ( horaAtual >= horarioAberto || horaAtual <= horarioFechado) {
return "ABERTO" ;
}
else {
return "FECHADO" ;
}
}
}
{
System .
out .
println ( "Horario normal\n " ) ;
System .
out .
println ( "Hora 18:00, Abertura 09:00 - Fecho 13:00, Estado " + verificarHorario( "1800" , "0900" , "1300" ) ) ;
System .
out .
println ( "Hora 07:00, Abertura 09:00 - Fecho 13:00, Estado " + verificarHorario( "0700" , "0900" , "1300" ) ) ;
System .
out .
println ( "Hora 12:00, Abertura 09:00 - Fecho 13:00, Estado " + verificarHorario( "1200" , "0900" , "1300" ) ) ;
System .
out .
println ( "\n Horario que passa o dia\n " ) ;
System .
out .
println ( "Hora 14:00, Abertura 17:30 - Fecho 01:00, Estado " + verificarHorario( "1400" , "1730" , "0100" ) ) ;
System .
out .
println ( "Hora 02:00, Abertura 17:30 - Fecho 01:00, Estado " + verificarHorario( "0200" , "1730" , "0100" ) ) ;
System .
out .
println ( "Hora 19:00, Abertura 17:30 - Fecho 01:00, Estado " + verificarHorario( "1900" , "1730" , "0100" ) ) ;
}
}
LyogcGFja2FnZSB3aGF0ZXZlcjsgLy8gZG9uJ3QgcGxhY2UgcGFja2FnZSBuYW1lISAqLwoKaW1wb3J0IGphdmEudXRpbC4qOwppbXBvcnQgamF2YS5sYW5nLio7CmltcG9ydCBqYXZhLmlvLio7CgovKiBOYW1lIG9mIHRoZSBjbGFzcyBoYXMgdG8gYmUgIk1haW4iIG9ubHkgaWYgdGhlIGNsYXNzIGlzIHB1YmxpY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kJdmVyaWZpY2FySG9yYXJpbygiMTgwMCIsICIwOTAwIiwgIjEzMDAiKSk7CgkJU3lzdGVtLm91dC5wcmludGxuKCJIb3JhIDA3OjAwLCBBYmVydHVyYSAwOTowMCAtIEZlY2hvIDEzOjAwLCBFc3RhZG8gIiArIAoJCXZlcmlmaWNhckhvcmFyaW8oIjA3MDAiLCAiMDkwMCIsICIxMzAwIikpOwoJCVN5c3RlbS5vdXQucHJpbnRsbigiSG9yYSAxMjowMCwgQWJlcnR1cmEgMDk6MDAgLSBGZWNobyAxMzowMCwgRXN0YWRvICIgKyAKCQl2ZXJpZmljYXJIb3JhcmlvKCIxMjAwIiwgIjA5MDAiLCAiMTMwMCIpKTsKCQkKCQlTeXN0ZW0ub3V0LnByaW50bG4oIlxuSG9yYXJpbyBxdWUgcGFzc2EgbyBkaWFcbiIpOwoJCQoJCVN5c3RlbS5vdXQucHJpbnRsbigiSG9yYSAxNDowMCwgQWJlcnR1cmEgMTc6MzAgLSBGZWNobyAwMTowMCwgRXN0YWRvICIgKyAKCQl2ZXJpZmljYXJIb3JhcmlvKCIxNDAwIiwgIjE3MzAiLCAiMDEwMCIpKTsKCQlTeXN0ZW0ub3V0LnByaW50bG4oIkhvcmEgMDI6MDAsIEFiZXJ0dXJhIDE3OjMwIC0gRmVjaG8gMDE6MDAsIEVzdGFkbyAiICsgCgkJdmVyaWZpY2FySG9yYXJpbygiMDIwMCIsICIxNzMwIiwgIjAxMDAiKSk7CgkJU3lzdGVtLm91dC5wcmludGxuKCJIb3JhIDE5OjAwLCBBYmVydHVyYSAxNzozMCAtIEZlY2hvIDAxOjAwLCBFc3RhZG8gIiArIAoJCXZlcmlmaWNhckhvcmFyaW8oIjE5MDAiLCAiMTczMCIsICIwMTAwIikpOwoKCX0KfQ==
stdout
Horario normal
Hora 18:00, Abertura 09:00 - Fecho 13:00, Estado FECHADO
Hora 07:00, Abertura 09:00 - Fecho 13:00, Estado FECHADO
Hora 12:00, Abertura 09:00 - Fecho 13:00, Estado ABERTO
Horario que passa o dia
Hora 14:00, Abertura 17:30 - Fecho 01:00, Estado FECHADO
Hora 02:00, Abertura 17:30 - Fecho 01:00, Estado FECHADO
Hora 19:00, Abertura 17:30 - Fecho 01:00, Estado ABERTO