Friday, February 6, 2009

說回那兩個程式

1)num = (num - (num%2))/2
why don't num/2
it is so strange -_________________-

2)for (int i = 0; i <= ch.length() -1; i++)
why I start from the first character?
the question ask "the last occurrence", why i don't search form the end
and once 'x' is found, return the position
then everything is done.

actually, i never think in this way.
-_____________________________-

No comments: