Find whether a given number is a perfect square or not
Presentation

I have re-indented your code, I do not know how your code is on your side but you should definitly indent it properly.
Also, you should remove useless lines.

Naming

check is not a good function name. isPerfectSquare would probably be easier for everyone to understand.

Documentation

Is it a good habit to add some documentation telling what your code is supposed to do. In your case, it could be nice to also tell the reader how it works.


  The expression for the nth square number is n2. This is also equal to the sum of the first n odd numbers.


Types

You can use the bool type in C++.