Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
19
Task/FizzBuzz/C-sharp/fizzbuzz-8.cs
Normal file
19
Task/FizzBuzz/C-sharp/fizzbuzz-8.cs
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
class Program
|
||||
{
|
||||
public static string FizzBuzzIt(int n) =>
|
||||
(n % 3, n % 5) switch
|
||||
{
|
||||
(0, 0) => "FizzBuzz",
|
||||
(0, _) => "Fizz",
|
||||
(_, 0) => "Buzz",
|
||||
(_, _) => $"{n}"
|
||||
};
|
||||
|
||||
static void Main(string[] args)
|
||||
{
|
||||
foreach (var n in Enumerable.Range(1, 100))
|
||||
{
|
||||
Console.WriteLine(FizzBuzzIt(n));
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue