You are viewing a single comment's thread. Return to all comments →
I went with StringBuilder too! in C#. Care more about performance than shorter code (though shorter is usually sweeter), which string builder is doing for both of us =]...
int n = Convert.ToInt32(Console.ReadLine());
StringBuilder floor = new StringBuilder(n*n);
for(int i = 1; i < n + 1; i++)
floor.Append(' ', n - i);
if(n != i) floor.Append(Environment.NewLine);