You are viewing a single comment's thread. Return to all comments →
c++
int squares(int a, int b) { int result = 0;
for(int i=1; i<=b;i++){ int square = pow(i, 2); if(square<= b and square>=a){ result++; }else if (square > b) { break; } } return result;
}
Seems like cookies are disabled on this browser, please enable them to open this website
Sherlock and Squares
You are viewing a single comment's thread. Return to all comments →
c++
int squares(int a, int b) { int result = 0;
}