Using namespace STD.
The class time {
Int h, m, s;
Public:
Time (int hh=0, int mm=0, int ss=0) : h (hh), m (mm), s (ss) {}
Time (int l);
Friend ostream & amp; Operator<(ostream& Out, time t);
Friend cost & amp; Operator> (istream& In time& T);
};
Ostream& Operator<(ostream& Out, time t) {
The out & lt; <"This time is" & lt;
}
Istream& Operator> (istream& In time& T) {
Cout & lt; <"Input time" & lt;
Return in;
}
Time: the time (int l) {
H=l/3600;
M=l % 3600/60;
S=l % 60;
}
Int main () {
Time t1 (9, 3, 30), t2;
Cout & lt;
Cin & gt;> T2;
Cout & lt;
Operator> (cin, t2);
Cout & lt;
Int s=3600;
T3=(s);
Cout & lt;
}
CodePudding user response:
You two constructors, because the one with the default parameters, so the time (int) method cannot confirm call that a,CodePudding user response:
That should be how to change theCodePudding user response: