-->
当前位置:首页 > 题库

PROGRAMMING:Define a time class time

Luz5年前 (2021-05-10)题库391
This topic requires the definition of a class time to implement the definition of related member functions
class Time
{
private:
int days;
int hours;
int minutes;
public:
Time(int d,int h, int m );
Time Sum(const Time & t);
void Show() const;
};
In the main() function, read in six integer values from the keyboard, assign values to two time objects respectively, and then output the sum of the two time objects.
###Input format:
Input, give two groups of integers in one line (3 in each group, meaning: day, hour, minute), a total of 6 values, separated by spaces.
###Output format:
Output the accumulated value of two time objects in one line, in the format of XX XX XX (where XX is the integer value, and the three integers mean day, hour and minute in turn)
###Input example:
```in
2 10 40 3 20 30
```
###Output example:
```out
6 7 10
```







answer:If there is no answer, please comment