Skip to content

Instantly share code, notes, and snippets.

@joaogui1
Created June 26, 2016 14:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save joaogui1/64be97b544a784ff526700a4d2752078 to your computer and use it in GitHub Desktop.
Save joaogui1/64be97b544a784ff526700a4d2752078 to your computer and use it in GitHub Desktop.
// calcula a parte inteira da raiz de n
int n, sq;
cin >> n;
for(sq = 1; sq*sq <= n; ++sq);
--sq;
cout << sq << "\n";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment