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"); }; 더보기 이전 1 다음