Created
October 17, 2017 08:57
-
-
Save anonymous/84acb6e4be006ce8e22968c639a668c7 to your computer and use it in GitHub Desktop.
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
using System; | |
namespace FizzBuzz | |
{ | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
for(int i=1;i<=100;i++) { | |
switch ((i % 3, i % 5)) { | |
case System.ValueTuple<int, int> t when t.Item1 == 0 && t.Item2 == 0: | |
Console.WriteLine("FizzBuzz"); | |
break; | |
case System.ValueTuple<int, int> t when t.Item1 == 0: | |
Console.WriteLine("Fizz"); | |
break; | |
case System.ValueTuple<int, int> t when t.Item2 == 0: | |
Console.WriteLine("Buzz"); | |
break; | |
default: | |
Console.WriteLine(i); | |
break; | |
} | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You can change your
case System.ValueTuple<int, int> t
expressions tocase var t