Who can help me about this question?
-
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
-
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
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--
-
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--
You got my 5...
-
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
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"); } } }
-
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"); } } }
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
-
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
Thank you, come again...
-
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--
I love your reply. It's so humorful hah...