HEEELP !

i have been given task in university and i still have no clue how to solve this :(

Given a natural number n. Print out the number obtained from the given number by throwing the digit k. (For example, if n = 12025 and k = 2, get 105). The division of a number into figures must be numerical.

(Create a program for both C ++ and Python. When logically incorrect data is entered, the program must issue a corresponding statement. It must be possible to execute the program repeatedly.)

Hope my english is okay :(
Hm, I read is several times but no idea how to get 105 from 12025 wit some k=2.

Do you have some more examples?
No only this is given, only thing what im thinking about is maybe when you take out all digits 2 from this n=12025 then maybe you get this 105. i clearly have no clue . x_x
Are you sure n=12025?
Because 105*105=11025 and this number is only one typo apart
yeah the n=12025, example was given from professor
take out all digits 2 from

That does sound right.

As in: Remove from number n all digits that equal k.
Guessing result for n=12025 with some k:
k result
0 1225
1 2025
2 105
3 12025
4 12025
5 1202
6 12025

If the n was a string, then you could look at each character. That was not allowed.

Start simple: Print each digit of n, from least to most significant.
Can you get this output:
5
2
0
2
1
Oh, I'm stupid :D Now it make sense.
then i was on right path :o now next part is to get the algorithm x_x
Topic archived. No new replies allowed.