You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
17 lines
374 B
Perl
17 lines
374 B
Perl
#!/usr/local/bin/perl
|
|
|
|
# collect the random numbers
|
|
$count = 1;
|
|
while ($count <= 100) {
|
|
$randnum = int( rand(10) ) + 1;
|
|
$randtotal[$randnum] += 1;
|
|
$count++;
|
|
}
|
|
|
|
# print the total of each number
|
|
$count = 1;
|
|
print ("Total for each number:\n");
|
|
while ($count <= 10) {
|
|
print ("\tnumber $count: $randtotal[$count]\n");
|
|
$count++;
|
|
} |