Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
17
Task/FizzBuzz/C-sharp/fizzbuzz-3.cs
Normal file
17
Task/FizzBuzz/C-sharp/fizzbuzz-3.cs
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue