#!/usr/bin/perl
$length = 47;
$round = 6;
for($i = 0; $i < $length; $i++)
{
$a[$i] = $i + 1;
}
print "\n";
for($j = 0; $j < $round; $j++)
{
$k = int(rand(($length) - $j));
$num= $a[$k];
$num_1 = $j + 1;
print "Round $num_1 draws: $num\n";
for($t = $k; $t < $length + 1; $t++)
{
$a[$t] = $a[$t + 1];
$a[$length] = 0;
}
}
$d = int(rand($length - ($round + 1)));
$spec = $a[$d];
print "\n";
print "The special number is: $spec\n";
print "\n";
基于作者乃Free Software Foundation與GNU的支持者, 所以你可以自由的使用我的程式碼, 修改我的程式碼.
No comments:
Post a Comment