18 lines
465 B
C#
18 lines
465 B
C#
using System;
|
|
using System.Linq;
|
|
|
|
namespace FizzBuzz
|
|
{
|
|
class Program
|
|
{
|
|
static void Main(string[] args)
|
|
{
|
|
Enumerable.Range(1, 100)
|
|
.Select(a => String.Format("{0}{1}", a % 3 == 0 ? "Fizz" : string.Empty, a % 5 == 0 ? "Buzz" : string.Empty))
|
|
.Select((b, i) => String.IsNullOrEmpty(b) ? (i + 1).ToString() : b)
|
|
.ToList()
|
|
.ForEach(Console.WriteLine);
|
|
}
|
|
}
|
|
}
|