Created
August 4, 2017 11:02
-
-
Save jonny-novikov/b2ba6aaf6274395b5803248d69fb7aef to your computer and use it in GitHub Desktop.
fizzbuzz
This file contains 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; | |
public string GetResult(int number) { | |
if (number % 3 == 0) { | |
if (number % 5 == 0) return "fizzbuzz"; | |
return "fizz"; | |
} | |
if (number % 5 == 0) return "buzz"; | |
return number.ToString(); | |
} | |
string res = string.Empty; | |
for(int i = 0; i <= 100; i++) | |
res += GetResult(i) + " "; |
This file contains 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
<?xml version="1.0" encoding="utf-8"?> | |
<packages> | |
<package id="ServiceStack.Text" version="4.0.62" targetFramework="net45" /> | |
<package id="ServiceStack.Client" version="4.0.62" targetFramework="net45" /> | |
<package id="ServiceStack.Interfaces" version="4.0.62" targetFramework="net45" /> | |
</packages> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment