
print "\tThai Generator ID By ICheer_No0M\n\n";
print "Input Round : ";
chomp($input=<stdin>);
for($i=1;$i<=$input;$i++)
{
$id1 = int(rand(9));
$id2 = int(rand(9));
$id3 = int(rand(9));
$id4 = int(rand(9));
$id5 = int(rand(9));
$id6 = int(rand(9));
$id7 = int(rand(9));
$id8 = int(rand(9));
$id9 = int(rand(9));
$id10 = int(rand(9));
$id11 = int(rand(9));
$id12 = int(rand(9));
$step1=($id1*13)+($id2*12)+($id3*11)+($id4*10)+($id5*9)+($id6*8)+($id7*7)+($id8*6)+($id9*5)+($id10*4)+($id11*3)+($id12*2);
$step2=$step1%11;
$step3=11-$step2;
if ($step3==11){
$step3=1;
}
elsif ($step3==10){
$step3=0;
}
print ("\nThai ID ".$i." : ".$id1."-",$id2,$id3,$id4,$id5."-",$id6,$id7,$id8,$id9,$id10."-",$id11,$id12."-",$step3)."\n";
}
<stdin>;
รู้ว่ามีคนเขียนเยอะแล้ว แต่ก็อยากลองเขียนดูบ้างครับ ^_^
ไม่มีความคิดเห็น:
แสดงความคิดเห็น