-
-
Save taylonr/831cb14cbf46af127b22 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 UnsignedInteger = System.UInt16; // Sorry, I can't unabbreviate it on the RHS | |
// https://twitter.com/taylonr/status/712277308363542530 | |
namespace FizzBuzz | |
{ | |
class Program | |
{ | |
static void Main(System.String[] args) | |
{ | |
System.String outV = System.String.Empty; // Yeah yeah, StringBuilder | |
for (UnsignedInteger cn = 1; cn <= 100; cn += 1) | |
{ | |
if (cn % 3 == 0) | |
{ | |
outV += "Fizz"; | |
} | |
if (cn % 5 == 0) | |
{ | |
outV += "Buzz"; | |
} | |
if (System.String.Empty == outV) | |
{ | |
outV = cn.ToString(); | |
} | |
System.Console.WriteLine(outV); | |
outputValue = System.String.Empty; | |
} | |
System.Console.WriteLine(); | |
System.Console.WriteLine("Done."); | |
System.Console.ReadKey(); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment