Comment detail

LL Golf Hole 8 - 横向きのピラミッドを作る (Nested Flatten)

This comment is reply for 7448 lemonade: 実質一行になるように書いてみました。 (LL Golf Hole 8 - 横向きのピラミッドを作る). Go to thread root.

少し短くなりました。

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
using System;
using System.Linq;

class Program
{
    static void Main(string[] args)
    {
        var a = Enumerable.Range(1, args.Length != 0 ? int.Parse(args[0]) : 4);
        a.Concat(a.Reverse().Skip(1)).Select(n => new string('*', n)).ToList().ForEach(Console.WriteLine);
    }
}

Index

Feed

Other

Link

Pathtraq

loading...