Created
February 27, 2014 08:04
-
-
Save masaru-b-cl/9246185 to your computer and use it in GitHub Desktop.
semicolonless FizzBuzz
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
if ( | |
System.Linq.Enumerable.ToList( | |
System.Linq.Enumerable.Select( | |
System.Linq.Enumerable.Range(1, 100), | |
n => | |
n % 3 == 0 && n % 5 == 0 ? "FizzBuzz" : | |
n % 3 == 0 ? "Fizz" : | |
n % 5 == 0 ? "Buzz" : | |
n.ToString() | |
) | |
).ForEach(System.Console.WriteLine) is object) { } | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment