0
#! /usr/bin/perl
use strict;
use warnings;
my @array = ('0'..'9');
print "Enter the inp No's : ";
while (($inp = <STDIN>) cmp "\n"){
}
安格斯> perl的no.pl 輸入INP不:12123213123如何分割數字計數沒有談到在Perl次
我試圖找到多少次,每次不來以及所有位數的總和。如何分割每個數字並找到其發生的位置
這很好用。你能解釋一下這條線是什麼嗎?「$ digits {$ _} ++ split //,$ inp;」 – Angus
@Angus:'split //'返回一個字符列表。 'for'在列表中循環,'++'遞增,因此對於每個字符,與其對應的%位數值遞增。 – choroba