using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace zuhe
{
class Program
{
static public void zuhe(char[] c, StringBuilder s, int level)
{
for (int i = level; i < c.Length; i++)
{
s.Append(c[i]);
Console.WriteLine(s);
if (level < c.Length - 1)
{
level++;
zuhe(c, s,level);
}
s.Length -= 1; //setting lower length to differ the new stringbuider from the old
}
}
static void Main(string[] args)
{
string me = "abcd";
char[] my = me.ToCharArray();
StringBuilder sb = new StringBuilder();
zuhe(my, sb, 0);
Console.ReadKey();
}
}
}