Challenge: Hours and Minutes

Lab C++ Beginner 10 points

Read a number of minutes and print how many whole hours and minutes that is, like 2 h 15 min.

Input

One integer: the total minutes (0 or more).

Output

One line: H h M min.

Example

Input

135

Output

2 h 15 min
Sample input available Sample output available
Editor
C++

Hints

Hours: total / 60 (integer division).

Minutes left over: total % 60.

Solution explanation

Integer division gives the whole hours and the remainder % gives the minutes left over.

Show solution
#include <iostream>
using namespace std;

int main() {
    int total;
    cin >> total;
    cout << total / 60 << " h " << total % 60 << " min\n";
    return 0;
}
Output
Answer
HOME LABS COMMUNITY DASHBOARD