Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- namespace HelloWorld
- {
- class MainClass
- {
- public static void Main(string[] args)
- {
- var FizzBuzz = Enumerable.Range(1, int.MaxValue)
- .Select(x =>
- (x % 15 == 0) ? "FizzBuzz" :
- (x % 3 == 0) ? "Fizz" :
- (x % 5 == 0) ? "Buzz" :
- x.ToString());
- FizzBuzz.Skip(0).Take(40).ToList().ForEach(x => System.Console.WriteLine(x));
- }
- }
- }
Add Comment
Please, Sign In to add comment