You are viewing a single comment's thread. Return to all comments →
it would be slightly more efficient, though, to do for(... i < sqrt ...) and if (sqrt*sqrt==n) sum += sqrt; in the end.
for(... i < sqrt ...)
if (sqrt*sqrt==n) sum += sqrt;
Seems like cookies are disabled on this browser, please enable them to open this website
Day 19: Interfaces
You are viewing a single comment's thread. Return to all comments →
it would be slightly more efficient, though, to do
for(... i < sqrt ...)
andif (sqrt*sqrt==n) sum += sqrt;
in the end.