ããã°ã©ãåé¡ã¨ãã¦æåãªfizz-buzzãæ¸ãã¦ã¿ã¾ãããæ¡ä»¶ã¯ä»¥ä¸ã®éãã§ãã ãâ´ï¼ããï¼ï¼ï¼ã¾ã§ã®æ°åãæ¸ãåºãâµãã ãï¼ã®åæ°ã®ã¨ãã¯ãfizzããï¼ã®åæ°ã®ã¨ãã¯ãbuzzããï¼ã¨ï¼ã®å ¬åæ°ã®å ´åã¯ãfizzbuzzãã¨åºãããã«ããã #!usr/local/bin/perl use strict; use warnings; foreach my $x (1..100){ my $three = ($x % 3); my $five = ($x % 5); if(!$three && !$five){ $x = 'fizzbuzz'; }elsif(!$three){ $x = 'fizz'; }elsif(!($five)){ $x = 'buzz'; } print "$x\n"; } ä¸é æ¼ç®åãç¨ãããå¼ã®å½¢å¼ããããã ãã§ãã£ã¨ç°¡ç¥åãããã¨ãå¯è½ã§ãã per
{{#tags}}- {{label}}
{{/tags}}