Introducing Regexps - minor problems

Back to Problem Solutions forum

Guy Gervais     2014-08-22 17:09:02
User avatar

In the problem description, it says:

- binary could be written as `0b1000101` or `1000101h`;

but it should be "b" and not "h" for that last character.

It also says:

- values consisting of digits `0-9` are considered decimals.

but the corrector does not interpret "012345" as decimal (it leaves it as-is...). Since it is a value consisting of the digits 0-9 (although with a leading zero), it is not entirely clear what we should do with those.

Rodion (admin)     2014-08-22 17:17:24
User avatar

> but it should be "b" and not "h".

Oh, thanks! I should be more attentive why copy-pasting...

> but the corrector does not interpret "012345"

I'm sorry but what is "corrector" in this context? As far as I remember C/C++ compilers use leading zero to specify the value is octal and if it contains wrong digits (like 0189) the error is generated.

Within this task I think it 0189 should not be recognized, while 012345 should be converted to oct... If it does not behave so, I'm afraid it is a bug... But now it looks like working for 012345 for me...

Probably I should improve problem statement also.

Guy Gervais     2014-08-22 17:20:56
User avatar

Sorry, I meant something like "09898"... not octal. My confusion was that "0189" is a decimal value consisting of the digits 0-9. Maybe specifying "not beginning with "0" would clarify?

The "corrector" is the part of the site that checks our solutions. :)

The last part that is not entirely clear is that the "b", "x" and "h" characters are not case-sensitive. Since the description specifies that the hex digits are not case sensitive, it gives the impression that others are. It might be clearer to state that nothing is case-sensitive.

Rodion (admin)     2014-08-22 17:43:07
User avatar

Thanks a lot! I've tried to improve problem statement on both points!

Sorry for confusion, please :)

Guy Gervais     2014-08-22 17:56:48
User avatar

I just read the revised version and it seems much clearer to me now.

Please login and solve 5 problems to be able to post at forum