cryptarithmetic loop

hello can anyone help me.. write a program that finds solutions to the cryptarithmetic puzzle of: TOO + TOO + TOO + TOO = GOOD

Last edited on
What problems are you having?
Is this program meant to solve any puzzle or just that one?
yes just that one..
Last edited on
No one is going to do your homework for you. An explanation is given. If there is some part you don't understand, ask specific questions.
i dont know how to make it because im so new in c++..can you help me where i can found the note that related to the question and i will do it with myself..
Nested for loops look like this:
1
2
3
4
5
for (int T = 0; T < 10; T++) {
   for (int O = 0; O < 10; O++) {
      //...
   }
}

You'll need two more for G and D.
When you do that, construct all the numbers in the innermost loop. TOO would be constructed like this:
1
2
int TOO = 
   100 * T + 10 * O + O;

Do the same for GOOD. Finally, test the equation with
1
2
3
if (TOO + TOO + TOO + TOO == GOOD) {
   //you've found a solution
}
owh now im understand..thank you so much and i will try my best...but can i ask another question? what meaning of buoyant force? owh im sorry coz ask you...
Last edited on
Why ask a C++ forum about physics when you can find that information yourself so easily???

http://www.google.com/search?q=buoyant+force&ie=utf-8&oe=utf-8&aq=t&rls=com.frontmotion:en-US:unofficial&client=firefox-a
im sory bcoz i just get the question from c++ book then i want to try it...it is bcoz i want to learn c++...n thank you so much...
Topic archived. No new replies allowed.