Skip to content

Instantly share code, notes, and snippets.

@freeonterminate
Last active October 17, 2016 07:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save freeonterminate/6363256 to your computer and use it in GitHub Desktop.
Save freeonterminate/6363256 to your computer and use it in GitHub Desktop.
条件文使わない FizzBuzz
program FizzBuzz;
uses
System.SysUtils;
var
i: Integer;
Values: array [0.. 3] of String = ('', 'Fizz', 'Buzz', 'FizzBuzz');
begin
for i := 1 to 100 do
begin
Values[0] := i.ToString;
Writeln(Values[Ord(i mod 3 = 0) or (Ord(i mod 5 = 0) shl 1)]);
end;
end.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment