Go4Expert

Go4Expert (http://www.go4expert.com/)
-   C (http://www.go4expert.com/forums/c/)
-   -   Question for smarts (http://www.go4expert.com/forums/question-for-smarts-t2162/)

The_Master 7Dec2006 18:14

Question for smarts
 
Hi guys how are you ?! hope you are ok
first of all i'd like to thank you for this wonderfull forum....
I have a problem with c++ . basically i tried to solve a program for 10 days and i didn't reach to any thing. also i tried to ask other people and other forums and they couldn't solve my question. so i wonder if you could help me to write it in c++ language.
please i'm very depressed... i wish that you help me.
Thank you
comment: the question text is in this link http://www.9q9q.org/index.php?image=6ntgFbxvukmj

DaWei 7Dec2006 21:14

Re: Question for smarts
 
The answer is simple. Print it out, roll it into a ball, and shove it up your trailing orifice.

Chaster 8Dec2006 17:08

Re: Question for smarts
 
You could decompose 2 numbers into digits, and place them into arrays. (nr mod 10 gives the last digit, then nr div 10 -> the nr without its last digit). Then you can write a function which returns the nr of different digits of two arrays. If the returned value !=1 the answer is false(break). When you reach the end of the sequence you have to call this function once again, to compare the first and the las numbers. If the value is 1 again you shuld print true.


All times are GMT +5.5. The time now is 23:09.