Guest User

Untitled

a guest
Oct 16th, 2017
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.65 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4.  
  5. namespace HelloWorld
  6. {
  7. class MainClass
  8. {
  9. public static void Main(string[] args)
  10. {
  11. var FizzBuzz = Enumerable.Range(1, int.MaxValue)
  12. .Select(x =>
  13. (x % 15 == 0) ? "FizzBuzz" :
  14. (x % 3 == 0) ? "Fizz" :
  15. (x % 5 == 0) ? "Buzz" :
  16. x.ToString());
  17.  
  18. FizzBuzz.Skip(0).Take(40).ToList().ForEach(x => System.Console.WriteLine(x));
  19. }
  20. }
  21. }
Add Comment
Please, Sign In to add comment