Perl 썸네일형 리스트형 [Perl]절대값 구하기 숫자를 한개 입력하여, 그 수의 절대치를 출력한다. 이것의 입력이 없어질때까지 반복시킨다. use strict;use warnings; my $str; while (1) {print "Please enter the number.(Enter exit at the end) ";$str = ;chomp $str; if ($str eq "exit" || $str eq "") {last;} if ($str =~ /[a-zA-Z]/) {print "Not number.\n";next;} print (abs($str), "\n"); }; 더보기 [Perl]홀수, 짝수 구하기 1부터 15까지의 수를 각각 한행씩, 전부 15행출력한다. 그때, 홀수짝수를 구별을 하기위해, 숫자의 두에 각각 [Even](홀수) 혹은 [Odd](짝수)의 문자열을 첨가. use strict;use warnings; for (my $i = 1; $i 더보기 이전 1 2 다음