Created
March 28, 2012 10:25
-
-
Save niryuu/2225263 to your computer and use it in GitHub Desktop.
pas-fizzbuzz
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
PROGRAM FIZZBUZZ; | |
PROCEDURE FIZZ_BUZZ(N: INTEGER); | |
VAR | |
I: INTEGER; | |
BEGIN | |
FOR I := 1 TO N DO BEGIN | |
IF I MOD 15 = 0 THEN BEGIN | |
WRITELN('FizzBuzz'); | |
END ELSE IF I MOD 5 = 0 THEN BEGIN | |
WRITELN('Buzz'); | |
END ELSE IF I MOD 3 = 0 THEN BEGIN | |
WRITELN('Fizz'); | |
END ELSE BEGIN | |
WRITELN(I); | |
END | |
END | |
END; | |
BEGIN | |
FIZZ_BUZZ(100); | |
END. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment