Search:
Type: Posts; User: tony_yum
Search:
Search took 0.05 seconds.
-
Oh yeah :) that's for the correction
-
Here's my little function :), assuming the integer 0 is the least significant bit in the unsigned char.
void flip (unsigned char *c, int i)
{
unsigned char p = (unsigned char)pow(2.0,...
-
A slightly cheating version in ruby :D . Doesn't take into account that there might be more then one space between words.
#!/usr/bin/ruby
sentences = 'whats the matter with kansas. I like...
-
(100000..999999).each { | x |
(2..9).each { |y |
if x.to_s == (x*y).to_s.reverse then
print "#{x} * #{y} = #{x*y}\n"
end
}
}
-
Haha or ruby
irb(main):001:0> "She sells seas shells on the sea shore".split.sort
=> ["She", "on", "sea", "seas", "sells", "shells", "shore", "the"]
-
How about:
echo 'She sells sea shells by the sea shore' | sed -e 's/[[:space:]]/\n/g' | sort
:)
|
|