Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- static void Main(string[] args)
- {
- int size = 20;
- String s1 = "";
- for (int i = 1; i <= size; i++)
- {
- s1 = string.Format("{0}-{1}-{0}", i,s1);
- Console.WriteLine(((i % 2 == 0) ? s1.Substring(0, s1.Length / 2 + 1) : s1.Substring(s1.Length / 2)).Trim('-'));
- }
- }
RAW Paste Data