Jump to content

Determine all the numbers that contain the same digits

- - - - -

  • Please log in to reply
1 reply to this topic

#1
programan

programan

    Newbie

  • Members
  • Pip
  • 1 posts
In a final set intervals (up to 10000) to determine all the numbers that contain the same digits.
sample:
interval 700
238–382-328-283, 582-285-258-528 ..

#2
CommittedC0der

CommittedC0der

    Speaks fluent binary

  • Members
  • PipPipPipPipPipPipPipPip
  • 1,565 posts
This is not exactly what your looking for but since you dont have any code to start with its better then nothing.

static void Main(string[] args)
        {
            int intervals = 0;
            int numbers = 123;
         
            Console.Write("How Many Intervals Would You Like? ");
            intervals = Convert.ToInt32(Console.ReadLine());
          
            for (int i = 0; i <= intervals; i++)
            {                    
                    if(i == numbers)
                    {
                        Console.WriteLine("Match: " + i);
                    }
                        
            }
            Console.ReadLine();
        }
Basickly all it does is ask the user for an interval, and goes through all the combination's . But The user isnt allowed to enter the numbers he wants to find, there just chosen by you in the code, I suggest finding away to take user input and convert the numbers into all combination's so you can search for them later.

Anyway hope this helped, with a little more effort on your part, i think people will be more willing to help you. :)
Btw this code is for a console app.
A man can be defined by what he does when no one is looking.
Science is only an educated theory, which we cannot disprove.




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users