using System; using System.Collections; class P { static void Main() { string s, ch, line = "", spaces = ""; string[] lines = new string[10]; int len = 0, i = 0, j=0, k=0, count = 1, max = 0; bool test = false; int ti = 0; string[,] t = { { "Today is the day.", null, null, null, null, null, null, null, null }, { "Idle hands are the devil's workshop.", "An eye for an eye, and a tooth for a tooth.", "Call a spade a spade.", "Failure teaches success.", null, null, null, null, null }, { "A wonder lasts but nine days.", "Better be first in the village than second at Rome.", "Catch your bear before you sell its skin.", "Divide and rule.", "Everybody's business is nobody's business.", "Fair is foul, and foul is fair.", "He who chooses takes the worst.", "It will be all the same a hundred years hence.", null } }; if (test) { s = t[ti, len]; } else { s = Console.ReadLine(); } do { lines[len] = s; count = lines[len].Length; max = count > max ? count + len : max + 1; len++; if (test) { s = t[ti, len]; } else { s = Console.ReadLine(); } } while (s != null); for (i = max; i >=0; i--) { line = ""; spaces = ""; for (k = 0; k < i - len; k++) { spaces += " "; } for (j = 0; j < len; j++) { count = i - (len - j); if (count >= 0) { if (count < lines[j].Length) { ch = lines[j].Substring(count, 1); line += spaces + lines[j].Substring(count, 1); spaces = " "; } else { spaces += " "; } } else { spaces += " "; } } if (i != max || line.Length != 0) { Console.WriteLine(line); } } } }