Var DepHour,DepMin,DurHour,DurMin,ArrHour,ArrMin:integer; begin readln(DepHour,DepMin,DurHour,DurMin); if DepMin+DurMin>=60 then begin ArrHour:=DepHour+DurHour+1; ArrMin:=DepMin+DurMin-60; end else begin ArrHour:=DepHour+DurHour; ArrMin:=DepMin+DurMin; end; write(ArrHour,':',ArrMin); end.
#include <stdio.h>
int main(void)
{int DepHour,DepMin,DurHour,DurMin,ArrHour,ArrMin;
scanf("%d %d %d %d",&DepHour,&DepMin,&DurHour,&DurMin);
if(DepMin+DurMin>=60)
{ArrHour=DepHour+DurHour+1;
ArrMin=DepMin+DurMin-60;}
else
{ArrHour=DepHour+DurHour;
ArrMin=DepMin+DurMin;}
printf("%d:%d",ArrHour,ArrMin);
return 0;}
//PascalABC.NET 3.2 сборка 1318
Var
DepHour,DepMin,DurHour,DurMin,ArrHour,ArrMin:integer;
begin
readln(DepHour,DepMin,DurHour,DurMin);
if DepMin+DurMin>=60 then
begin
ArrHour:=DepHour+DurHour+1;
ArrMin:=DepMin+DurMin-60;
end
else
begin
ArrHour:=DepHour+DurHour;
ArrMin:=DepMin+DurMin;
end;
write(ArrHour,':',ArrMin);
end.
Пример ввода:
1 40 12 23
Пример вывода:
14:3