Question for smarts

The_Master's Avatar
Newbie Member
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
DaWei's Avatar, Join Date: Dec 2006
Team Leader
The answer is simple. Print it out, roll it into a ball, and shove it up your trailing orifice.
Chaster's Avatar, Join Date: Dec 2006
Newbie Member
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.