Софтуерно Инженерство
Loading...
+ Нов въпрос
gina78 avatar gina78 -7 Точки

Задача , не мога да намеря грешката си

Задача , не мога да намеря грешката си къде съм допуснала грешка ,джеч ми дава 93 / 100

Кода:

<?php

$examHour = intval(readline());
$examMinute = intval(readline());
$comingHour = intval(readline());
$comingMinute = intval(readline());
$timeExam = $examHour * 60 + $examMinute;
$timeArrival = $comingHour * 60 + $comingMinute;
if ($timeArrival > $timeExam) {
    $lateTime = $timeArrival - $timeExam;
    if ($lateTime < 60) {
        echo "Late $lateTime minutes after the start";
    } else if ($lateTime > 60) {
        $timeH = floor($lateTime / 60);
        $timeMinute = $lateTime % 60;
        if ($timeMinute < 10) {
            echo "Late $timeH:0$timeMinute hours after the start";
        } else {
            echo "Late $timeH:$timeMinute hours after the start";
        }
    }
} else if (($timeArrival + 30 >= $timeExam) && ($timeArrival <= ($timeExam + 30))) {
    $timeOntime = $timeExam - $timeArrival;
    if ($timeOntime > 0) {
        echo "On time $timeOntime minutes before the start";
    } else if ($timeOntime >= 60) {
        $timeH = floor($timeOntime / 60);
        $timeMinute = $timeOntime % 60;
        if ($timeMinute < 10) {
            echo "On time $timeH:0$timeMinute hours before the start";
        } else {
            echo "On time $timeH:$timeMinute hours before the start";
        }
    } else {
        echo "On time";
    }
} else if ($timeArrival < $timeExam) {
    $earlyTime = $timeExam - $timeArrival;
    if ($earlyTime < 60) {
        echo "Early $earlyTime minutes before the start";
    } else if ($earlyTime >= 60) {
        $timeH = floor($earlyTime / 60);
        $timeMinute = $earlyTime % 60;
        if ($timeMinute < 10) {
            echo "Early $timeH:0$timeMinute hours before the start";
        } else {
            echo "Early $timeH:$timeMinute hours before the start";
        }
    }
}

Тагове:
0
Programming Basics with PHP
marivmari avatar marivmari 2 Точки

коя е задачата?

0