0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

多言語FizzBuzzAdvent Calendar 2022

Day 23

多言語FizzBuzzチャレンジ23日目:Perl

Last updated at Posted at 2022-12-22

これまでのまとめ

本日のお品書き

二日続けて手続型言語です。さくさくいきたいですね。

FizzBuzz

fizzbuzz.pl
foreach $i ((1..100)) {
  if ($i % 15 == 0) {
    print "FizzBuzz\n";
  } elsif($i % 3 == 0) {
    print "Fizz\n";
  } elsif($i % 5 == 0) {
    print "Buzz\n";
  } else {
    print "$i\n";
  }
}

おまけ;実行方法

perl fizzbuzz.pl
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?