Claudio wrote:
I am dealing with this "easy" C++ problem.
Introduction
Each number in a phone keyboard is associated to a set of tree chars.(i.e
2 = ABC).
Programming
Given 7 number in the range from 2 to 9 ( 0 and 1 not included ), the
program has to write all the combinations of chars (2187 = 3^7) in a file.
I am looking for some hints.
Your post is most likely some kind of homework. Read "How do I get other
people to do my homework problem for me?" at:
http://www.parashift.com/c++-faq-lit...t.html#faq-5.2
Checking the FAQ before posting is always good.
That FAQ (I haven't read it yet) might warn you that simple questions might
still get answers like this:
You are asking not how to sort but how to count, meaning how to enumerate
values in a place-based notation. We are all familiar with the 10-digit
counting scheme we inherit from our primate ancestors. But your mission is
to count in base 24 (8 digits * 3 letters per digit).
So, iterate from 0 to 2187, convert each number from an integer to base 24,
and map each resulting digit onto a letter.
--
Phlip
http://www.c2.com/cgi/wiki?DevNull
-- But all the other programmers were doing it! --