You are viewing a single comment's thread. Return to all comments →
con anyone fix my c++ solution please
string solve(int n) { int x = 0; int pl =0; for(int i = 1; i<n/2+1;i++){ if(n%i==0){ x++; if(i%2==0){ if(sqrt(i) == (int)sqrt(i)){ pl++; } } } } if(pl == 0){ return to_string(0); } return (to_string(pl)+"/"+to_string(x)); }
Seems like cookies are disabled on this browser, please enable them to open this website
Mehta and his Laziness
You are viewing a single comment's thread. Return to all comments →
con anyone fix my c++ solution please