10
6
Hãy luôn nhớ cảm ơn và vote 5*
nếu câu trả lời hữu ích nhé!
uses crt;
var h, m, s, ss: longint;
begin
clrscr;
read(h, m, s, ss);
s:= s+ss;
if s >= 60 then
begin
m:=m + s div 60;
s:=s mod 60;
end;
if m >= 60 then
begin
h:=h + m div 60;
m:=m mod 60;
end;
writeln(h,' ', m,' ', s);
end.
Hãy giúp mọi người biết câu trả lời này thế nào?
12
4
#include <bits/stdc++.h>
using namespace std;
int main()
{
int h,p,s;
cin>>h>>p>>s;
if((h<23)and(p<=59)and(s<59))
cout<<h<<" "<<p<<" "<<s+1;
else if((h<23)and(p<59)and(s==59))
cout<<h<<" "<<p+1<<" "<<"00";
else if((h<23)and(p==59))
cout<<h+1<<" "<<"00"<<" "<<"00";
else if(h==23)
cout<<"0"<<" "<<"0"<<" "<<"0";
return 0;
}
Hãy giúp mọi người biết câu trả lời này thế nào?
Bảng tin