ldrugsnw   2년 전

#include

using namespace std;

int main(){

int h{0}, m{0}, a{0}, b{0}; // b는 더해지는 시간!

cin >> h >> m ;

cout << "\n";

cin >> a;

b = ((m+a)/60);

if (m+a < 60){

cout << h << m+a << endl;

}

else{

if (h+b < 24){

cout << h+b << (m+a)-60*b << endl;

}

else {

cout << h+b-24 << (m+a)-60*b << endl;

}

}

return 0;

}

ldrugsnw   2년 전

참고로 #include 옆에 <iostream> 있습니다 ㅠ

댓글을 작성하려면 로그인해야 합니다.