Skip to content

Instantly share code, notes, and snippets.

@hissy
Last active July 3, 2019 21:53
Show Gist options
  • Save hissy/ad620d6becd04c97c475ef1d6f705ced to your computer and use it in GitHub Desktop.
Save hissy/ad620d6becd04c97c475ef1d6f705ced to your computer and use it in GitHub Desktop.
FizzBuzz for PHP 出題ファイル
<?php
/**
* FizzBuzz 問題
* * 3で割り切れる場合は Fizz と出力
* * 5で割り切れる場合は Buzz と出力
* * 3でも5でも割り切れる場合は Fizz Buzz と出力する
*
* Fork ボタンでフォークして作業開始
*
* スクリプトの実行方法 $ php fizzbuzz.php
*
* 調べていいのは https://www.php.net だけ!
*/
$numbers = range(1,100);
foreach ($numbers as $number) {
echo $number;
echo PHP_EOL;
}
echo PHP_EOL;
@hissy
Copy link
Author

hissy commented Jul 1, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment