risolto...
http://www.matematicamente.it/forum/...mo-t60048.html
è in c ma si capisce...