
ronald29x
New User
Jul 27, 2005, 9:55 PM
Post #3 of 3
(1507 views)
|
|
Re: [davorg] Counting characters
[In reply to]
|
Can't Post
|
|
thanks for the answer davorg. now i want to count for more than 1 word and the input is from the stdin. the number of matches characters (n) is printed in the form of power 2 (2^n) (ex: 1, 2, 4, 8, etc ). each one is separated by space. actually i have make some code, but i need shorter code, if u have any idea how to make it shorter, please reply me soon, thank you. my code: print "2**($a=/[FTLD]/g) " while<> after i read your reply: print 2**(tr/'FTLD'//).$/ while<> and i've changed it again: print 2**y/FTLD//.$/ while<> note: you can omit all the 'use' keyword, etc. just make it very very short i want to make it 24 characters length of code or less thanks
(This post was edited by ronald29x on Jul 28, 2005, 2:07 AM)
|