Created
June 9, 2009 13:02
-
-
Save koduki/126469 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
<?php | |
print "演算子優先順位がへんだから、期待通りに動作しない\n"; | |
foreach(range(1, 30) as $x){ | |
print ($x % 15 == 0) ? "FizzBuzz" | |
:($x % 5 == 0) ? "Fizz" | |
:($x % 3 == 0) ? "Buzz" | |
: $x; | |
print "\n"; | |
} | |
print "Lisp並にカッコつければOK\n"; | |
foreach(range(1, 30) as $x){ | |
print (($x % 15 == 0) ? "FizzBuzz" | |
:(($x % 5 == 0) ? "Fizz" | |
:(($x % 3 == 0) ? "Buzz" | |
: $x))); | |
print "\n"; | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment