fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. int n, square = 0, countSqr = 0;
  6. cin >> n;
  7. for (int nr = 1; square <= n; ++nr) {
  8. square = nr * nr;
  9. ++countSqr;
  10. }
  11. cout << countSqr;
  12.  
  13. return 0;
  14. }
Success #stdin #stdout 0.01s 5284KB
stdin
8
stdout
3