奇科電腦 回奇科電腦首頁奇科電腦LPI課程資訊奇科電腦Embedded課程資訊奇科電腦Cisco課程資訊奇科電腦Programming課程資訊奇科電腦Smartphone App課程資訊
Tech Tips25  Take a string and a number (n) as standard in separately, and then repeat the string for n times to standard out.

Author: GeeGo|Date: 2010/03/01|Back to Tech Tips

#!/usr/bin/perl -w

my @in;
while(chomp($_ = )) {
push @in, $_;
last if $. >= 2;
}
print $in[0] x $in[1], "\n";


Best Browse: 1024x768 Copyright 2010 GeeGo Systems, Ltd.
service@geego.com.tw|DL: 0800-296-296|3F., No.60, Zhulun St., Zhongshan Dist., Taipei City 104, Taiwan (R.O.C.)|02-2711-6373