2006-07-28, 03:35 PM
|
#5 (permalink)
|
協調管理員
|
引用:
作者: 劍痞憶秋年
10 + 26 + 26 = 62 進制
<1>??使用多個for while if
==>這是條件嗎??一定要用這個嗎
<2>要寫什麼,小弟看的不是很明確
是要寫 62進制的 加法嗎
<3>用什麼寫??(小弟也只會 VB)
|
我討論的話,通常是不會討論用什麼語言
通常都是討論方法,像if for while都是大多數語言都會有的迴圈
還有print或printf
我自己是有寫perl版的序號產生:
no.txt 內容
引用:
0 1 2 3 4 5 6 7 8 9 a b c d e f g h i j k l m n o p q r s t u v w x y z A B C D E F G H I J K L M N O P Q R S T U V W X Y Z ~ ! @ # $ % ^ & * ( ) _ + - , . / ' " { } [ ] \ |
|
程式內容:
引用:
my $unit=3;#my為宣告,要產生幾位
my $cgirl=1;#第幾層向上層
my @arr=(0...$unit);#at為陣列宣告,產生0~3的一圍陣列,而陣列內容為[0][1][2][3]
for(my $i=0;$i<=$unit;$i++){#清空陣列內容
$arr[$i]=0;
}
my $i=0;
my $cc=0;
while(1){
my @no;
open (NOTXT,"no.txt")||print "don't open no.txt\n";#打開no.txt
while (my $notxt=<NOTXT>){
chomp $notxt;@no=split(/ / , $notxt);#從no.txt文字檔讀入要產生的字元0~|,放入陣列@no
}
$cc=$arr[$cgirl];
print "$no[$arr[$cgirl]]";
if($cgirl == $unit){
$arr[$cgirl]++;print "\n";
$cgirl=0;
}
print "-$cc-\n";
if($cc == 86){
$arr[$cgirl-1]++;
print "$arr[$cgirl-1]\n";
$cgirl=0;}
#$arr[$cgirl-1]++;
$cgirl++;
if(($arr[$cgirl]==87) && ($cgirl==86)){last;}
|
|
__________________
|
|
送花文章: 11706,
收花文章: 3363 篇, 收花: 16453 次
|