#include
using namespace std;
Int main () {
String STR.
Int n, a, h, m, s;
Cin> N;
While (n -) {
Cin> a;
Cin> STR;
H=(STR [0] - '0') * 10 + STR [1] - '0';
M=(STR [4] - '0') * 10 + STR [5] - '0';
S=(STR [8] - '0') * 10 + STR [9] - '0';
Cout
}
Why input 10:30:29 this kind of type string, such as when extracting hour is (STR [0] - '0') * 10 + STR [1] - '0'
But when the minute is (STR [4] - '0') * 10 + STR [5] - '0'
Why is an empty two positions
CodePudding user response:
The colon has a spaceCodePudding user response:
The cin> a; Remove and proved, breakpoints view STR content,CodePudding user response: