Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Who can help me about this question?

Who can help me about this question?

Scheduled Pinned Locked Moved C#
questioncsharphelp
7 Posts 5 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • F Offline
    F Offline
    Feelyn2008
    wrote on last edited by
    #1

    Please use C# to Print the following : 1 12 123 1234 12345 1235 124 1245 125 13 134 1345 135 14 145 15 2 23 234 2345 235 24 245 25 3 34 345 35 4 45 5

    C J 2 Replies Last reply
    0
    • F Feelyn2008

      Please use C# to Print the following : 1 12 123 1234 12345 1235 124 1245 125 13 134 1345 135 14 145 15 2 23 234 2345 235 24 245 25 3 34 345 35 4 45 5

      C Offline
      C Offline
      Colin Angus Mackay
      wrote on last edited by
      #2

      Console.WriteLine("1");
      Console.WriteLine("12");
      Console.WriteLine("123");
      Console.WriteLine("1234");
      Console.WriteLine("12345");
      Console.WriteLine("1235");
      Console.WriteLine("124");
      Console.WriteLine("1245");
      Console.WriteLine("125");
      Console.WriteLine("13");
      Console.WriteLine("134");
      Console.WriteLine("1345");
      Console.WriteLine("135");
      Console.WriteLine("14");
      Console.WriteLine("145");
      Console.WriteLine("15");
      Console.WriteLine("2");
      Console.WriteLine("23");
      Console.WriteLine("234");
      Console.WriteLine("2345");
      Console.WriteLine("235");
      Console.WriteLine("24");
      Console.WriteLine("245");
      Console.WriteLine("25");
      Console.WriteLine("3");
      Console.WriteLine("34");
      Console.WriteLine("345");
      Console.WriteLine("35");
      Console.WriteLine("4");
      Console.WriteLine("45");
      Console.WriteLine("5");

      --Colin Mackay--

      EuroCPian Spring 2004 Get Together[^]

      J F 2 Replies Last reply
      0
      • C Colin Angus Mackay

        Console.WriteLine("1");
        Console.WriteLine("12");
        Console.WriteLine("123");
        Console.WriteLine("1234");
        Console.WriteLine("12345");
        Console.WriteLine("1235");
        Console.WriteLine("124");
        Console.WriteLine("1245");
        Console.WriteLine("125");
        Console.WriteLine("13");
        Console.WriteLine("134");
        Console.WriteLine("1345");
        Console.WriteLine("135");
        Console.WriteLine("14");
        Console.WriteLine("145");
        Console.WriteLine("15");
        Console.WriteLine("2");
        Console.WriteLine("23");
        Console.WriteLine("234");
        Console.WriteLine("2345");
        Console.WriteLine("235");
        Console.WriteLine("24");
        Console.WriteLine("245");
        Console.WriteLine("25");
        Console.WriteLine("3");
        Console.WriteLine("34");
        Console.WriteLine("345");
        Console.WriteLine("35");
        Console.WriteLine("4");
        Console.WriteLine("45");
        Console.WriteLine("5");

        --Colin Mackay--

        EuroCPian Spring 2004 Get Together[^]

        J Offline
        J Offline
        je_gonzalez
        wrote on last edited by
        #3

        You got my 5...

        1 Reply Last reply
        0
        • F Feelyn2008

          Please use C# to Print the following : 1 12 123 1234 12345 1235 124 1245 125 13 134 1345 135 14 145 15 2 23 234 2345 235 24 245 25 3 34 345 35 4 45 5

          J Offline
          J Offline
          je_gonzalez
          wrote on last edited by
          #4

          using System; using System.Text; using System.Text.RegularExpressions; using System.Drawing; using System.Collections; namespace CodeProject { class SillyStuff { [STAThread] static void Main(string[] args) { ArrayList list = new ArrayList(); bool[] patt = new bool[] {false, false, false, false, false}; bool keeptruckin = true; while (keeptruckin) { keeptruckin = false; for (int loop1 = patt.GetLowerBound(0); loop1 <= patt.GetUpperBound(0); loop1++) { if (!patt[loop1]) { patt[loop1] = true; keeptruckin = true; break; } else { patt[loop1] = false; } } if (keeptruckin) { string buffer = string.Empty; for (int loop2 = patt.GetLowerBound(0); loop2 <= patt.GetUpperBound(0); loop2++) { if (patt[loop2]) buffer += (loop2 + 1).ToString(); } list.Add(buffer); } } list.Sort(); for (int loop3 = 0; loop3 < list.Count; loop3++) { Console.WriteLine(list[loop3]); } Console.WriteLine("DONE"); } } }

          D 1 Reply Last reply
          0
          • J je_gonzalez

            using System; using System.Text; using System.Text.RegularExpressions; using System.Drawing; using System.Collections; namespace CodeProject { class SillyStuff { [STAThread] static void Main(string[] args) { ArrayList list = new ArrayList(); bool[] patt = new bool[] {false, false, false, false, false}; bool keeptruckin = true; while (keeptruckin) { keeptruckin = false; for (int loop1 = patt.GetLowerBound(0); loop1 <= patt.GetUpperBound(0); loop1++) { if (!patt[loop1]) { patt[loop1] = true; keeptruckin = true; break; } else { patt[loop1] = false; } } if (keeptruckin) { string buffer = string.Empty; for (int loop2 = patt.GetLowerBound(0); loop2 <= patt.GetUpperBound(0); loop2++) { if (patt[loop2]) buffer += (loop2 + 1).ToString(); } list.Add(buffer); } } list.Sort(); for (int loop3 = 0; loop3 < list.Count; loop3++) { Console.WriteLine(list[loop3]); } Console.WriteLine("DONE"); } } }

            D Offline
            D Offline
            Daniel Turini
            wrote on last edited by
            #5

            You were subtle! You got my 5! Trying to make bits uncopyable is like trying to make water not wet. -- Bruce Schneier By the way, dog_spawn isn't a nickname - it is my name with an underscore instead of a space. -- dog_spawn

            J 1 Reply Last reply
            0
            • D Daniel Turini

              You were subtle! You got my 5! Trying to make bits uncopyable is like trying to make water not wet. -- Bruce Schneier By the way, dog_spawn isn't a nickname - it is my name with an underscore instead of a space. -- dog_spawn

              J Offline
              J Offline
              je_gonzalez
              wrote on last edited by
              #6

              Thank you, come again...

              1 Reply Last reply
              0
              • C Colin Angus Mackay

                Console.WriteLine("1");
                Console.WriteLine("12");
                Console.WriteLine("123");
                Console.WriteLine("1234");
                Console.WriteLine("12345");
                Console.WriteLine("1235");
                Console.WriteLine("124");
                Console.WriteLine("1245");
                Console.WriteLine("125");
                Console.WriteLine("13");
                Console.WriteLine("134");
                Console.WriteLine("1345");
                Console.WriteLine("135");
                Console.WriteLine("14");
                Console.WriteLine("145");
                Console.WriteLine("15");
                Console.WriteLine("2");
                Console.WriteLine("23");
                Console.WriteLine("234");
                Console.WriteLine("2345");
                Console.WriteLine("235");
                Console.WriteLine("24");
                Console.WriteLine("245");
                Console.WriteLine("25");
                Console.WriteLine("3");
                Console.WriteLine("34");
                Console.WriteLine("345");
                Console.WriteLine("35");
                Console.WriteLine("4");
                Console.WriteLine("45");
                Console.WriteLine("5");

                --Colin Mackay--

                EuroCPian Spring 2004 Get Together[^]

                F Offline
                F Offline
                Forrest Feather
                wrote on last edited by
                #7

                I love your reply. It's so humorful hah...

                1 Reply Last reply
                0
                Reply
                • Reply as topic
                Log in to reply
                • Oldest to Newest
                • Newest to Oldest
                • Most Votes


                • Login

                • Don't have an account? Register

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • World
                • Users
                • Groups