A
A
Anvario02022-01-05 19:06:06
C++ / C#
Anvario0, 2022-01-05 19:06:06

What is the essence of the task?

It is necessary to write a program according to the task, but I do not even understand the essence of the issue.
Task:
Find sequences of digits in the string, consider each of them as a number in the number system that corresponds to the maximum digit, replace the numbers in the string with symbols with codes derived from these numbers. Example: aaa010101bbb343ccc - binary and five-digit number systems.

The sequence must be considered in the number system that corresponds to the maximum digit, but in the example, this is not at all what is happening. Isn't the maximum digit in the sequence "010101" 1? Then why do we count in binary? In the second sequence "343" the largest digit is 4, but we count in fivefold. Why is that?
Second, "replace numbers in a string with characters derived from those numbers" - what does that even mean? What codes are we talking about?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
G
galaxy, 2022-01-05
@galaxy

Isn't the maximum digit in the sequence "010101" 1?
In the binary system, the maximum digit used is just 1. In the N-ary -N-1
Second, "replace numbers in a string with characters derived from those numbers" - what does that even mean?
ASCII codes most likely.
010101 2 = 21 - non-printing character NAK
343 5 = 98 - 'b'

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question