📜  s'entrainer 倾倒测试技术 developpeurs web - TypeScript 代码示例

📅  最后修改于: 2022-03-11 14:48:35.792000             🧑  作者: Mango

代码示例1
function fizzbuzz($liste) {
  foreach($liste as $n) {
    if($n%3 == 0 && $n%5 == 0) echo 'fizzbuzz';
    elseif($n%3 == 0) echo 'fizz';
    elseif($n%5 == 0) echo 'buzz';
    else echo $n;
    echo "\n";
  }
}
fizzbuzz([1, 2, 3, 4, 5, 7, 15, 20]);