Home > Back-end >  This program has what problem?
This program has what problem?

Time:03-25

Question is this: the UTC is the world's coordination, the BJT is Beijing time, UTC time is equal to the BJT minus 8, now, your program to read an integer, said of the BJT and points, when the integer bits and 10 points, one hundred and one thousand hours, the effective input range is 0 to 2359, namely your program could not read from the test server to input data outside of 0 to 2359, the input sample: 933, the output sample: 133,

I wrote this program errors, the third if that line change else just by the way, why? I think running result is right, didn't find something wrong with the debug,

CodePudding user response:

refer to the original poster weixin_56476859 response:
question is this: the UTC is one of the world coordinate, the BJT is Beijing time, UTC time is equal to the BJT minus 8, now, your program to read an integer, said of the BJT and points, when the integer bits and 10 points, one hundred and one thousand hours, the effective input range is 0 to 2359, namely your program could not read from the test server to input data outside of 0 to 2359, the input sample: 933, the output sample: 133,

I wrote this program errors, the third if that line change else just by the way, why? I think running result is right, didn't find something wrong with the debug,


Although does not affect the results, but your program inefficient, originally with the else need only a judgment, in 2 times if you want to 2 times, there is no need,

CodePudding user response:

That why I submit the answer shows error?? , into the else submit the answer is yes, the test system is not only to verify a few values? Two error judgment will lead to the result? Thank you for your

CodePudding user response:

reference 1st floor qq_39936465 response:
Quote: refer to the original poster weixin_56476859 response:
problem is this: the UTC is one of the world coordinate, BJT is Beijing time, UTC time is equal to the BJT minus 8, now, your program to read an integer, says BJT and points, when the integer bits and 10 points, one hundred and one thousand hours, the effective input range is 0 to 2359, namely your program could not read from the test server to input data outside of 0 to 2359, the input sample: 933, the output sample: 133,

I wrote this program errors, the third if that line change else just by the way, why? I think running result is right, didn't find something wrong with the debug,


Although does not affect the results, but your program inefficient, originally with the else need only a judgment, in 2 times if you want to 2 times, no need,

That why I submit the answer shows error?? , into the else submit the answer is yes, the test system is not only to verify a few values? Two error judgment will lead to the result? Thank you for your

CodePudding user response:

Use two if is make of what is wrong? Your judgment conditions either u<0 and vice u>=0 if the else is ok

CodePudding user response:

reference name 4th floor injured brain response:
with two the if is make of what is wrong? Your judgment conditions either u<0 and vice u>=0 if the else is ok

With twice the if a bit is not standard, but also not wrong
  • Related