1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Question for smarts

Discussion in 'C' started by The_Master, Dec 7, 2006.

  1. The_Master

    The_Master New Member

    Joined:
    Dec 7, 2006
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    0
    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
     
  2. DaWei

    DaWei New Member

    Joined:
    Dec 6, 2006
    Messages:
    835
    Likes Received:
    5
    Trophy Points:
    0
    Occupation:
    Semi-retired EE
    Location:
    Texan now in Central NY
    Home Page:
    The answer is simple. Print it out, roll it into a ball, and shove it up your trailing orifice.
     
  3. Chaster

    Chaster New Member

    Joined:
    Dec 8, 2006
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    0
    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.
     

Share This Page