Carlo Capocasa wrote:
>
> > Ah, the sign of a good programmer. :)
>
> There are actually people who still count, when
>
> for (int i=0;i<n;i++)
> cout << i << endl;
Shouldn't you put parentheses around on or the other of those
left shift operators? :-)
> is in itself a work of pristine beauty, immense practicality, and you
> can spend a lot of time lying around while the machine approaches n.
If you want pristine beauty, you should have a look the function
to find the intersection of two lists in Ocaml:
let rec intersect lst =
function
[] -> []
| head :: tail ->
if List.mem head lst then
head :: intersect lst tail
else
intersect lst tail
Erik
-- +-----------------------------------------------------------+ Erik de Castro Lopo +-----------------------------------------------------------+ "They should make peace with those who make peace, and wage war against those who wage war, and wage jihad against those who stand in the way of spreading the message of Islam and causing it to prevail of earth." http://islamqa.com/index.php?ln=eng&ds=qa&lv=browse&QR=26721&dgn=4Received on Sun Feb 26 20:21:36 2006
This archive was generated by hypermail 2.1.8 : Sun Feb 26 2006 - 20:21:36 EET