Created
March 4, 2022 13:16
-
-
Save argrath/cf46879e26ce6979bdb3ddb0990bbae7 to your computer and use it in GitHub Desktop.
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
use strict; | |
use warnings; | |
use utf8; | |
my @result = ( | |
undef, 'Fizz', 'Buzz', 'FizzBuzz', | |
'セブン', undef, undef, undef, | |
'イレブン', undef, undef, undef, | |
'セブンイレブン', undef, undef, 'いい気分', | |
); | |
for(my $i = 1; $i <= 2000; $i++){ | |
my $f = 0; | |
if($i % 3 == 0){ | |
$f += 1; | |
} | |
if($i % 5 == 0){ | |
$f += 2; | |
} | |
if($i % 7 == 0){ | |
$f += 4; | |
} | |
if($i % 11 == 0){ | |
$f += 8; | |
} | |
my $r = $result[$f] // $i; | |
print $r . "\n"; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment