My teachers assignment sheet:
AN interesting number is a non negative integer that contains at least one digit having the value 7. A REALLY interesting number that that is Xth in the sequence of interesting numbers, where X is an interesting number. for example 1234 is not interesting because none of its digits are 7. 27 is interesting but not really interesting because it is the third interesting number, and 3 is not interesting. 79 IS REALLY interesting because it is the 17th interesting number(preceded by 7, 17, 27, 37, 47, 57, 67, 70, 71, 72, 73, 74, 75, 76, 77, and 78) and 17 is interesting
I just really don't know how to use the %mod. So if nobody could help me with the above question, then maybe you could just explain the mod to me. thanks guys.
So you are referring to the modulo operator, this is a tool that C++ has to divide two integers and return the remainder. Here is a good source to learn about this operator.
lol. Ok so basically, Lets say that I want the interesting numbers in 4's. The 4th interesting number would be 34. The 14th interesting number would be 49. The 24th interesting number would 140. the 34th interesting number would be 154.
So, both numbers must both have a 4 in it. I am currently dying over this right now.
JoshHenry, yes that helps so much! Thank you for the explanation as well as the examples. But now I have to figure out how to loop that with a "for" loop. Lets say I wanted a 3 to be the interesting number, How could i output every 3 (3, 13, 23, 30, 31, 32, 33, 34, 35...etc)?