09. * Altitude от Simple Arrays
Здрасти колеги
Погледнете кода ми : ЕТО
ето и линк към judge : КЛИК
:D незнам къде греша дава ми 80/100 пък кода според мен е правилен, но погледнете и вие.
условието на задачата:
" You are an airplane pilot, trying to maneuver your airplane to safety from an unknown danger.
An array holds a sequence of up / down commands and numbers. Its first element always holds the initial altitude. The command up increases the altitude by the next number, while the command down decreases the altitude by the next number.
If at any point the altitude becomes either zero or negative, print “crashed” and end the program. If by the end, the altitude is positive, however, print “got through safely. current altitude: {altitude}m”. "
С double дава 100/100