Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and medical aesthetics - The C++ problem sqrt cannot be applied to plastic surgery.
The C++ problem sqrt cannot be applied to plastic surgery.
Yes, the sqrt () parameter cannot be an integer. Three forms of sqrt function

Double sqrt (double x);

float sqrtf(float x);

long double sqrtl(long double x);

You can declare m as double and k as double.

Then if(m%i==0) is used to forcibly convert m into plasticity.

I feel that Cicinho's answer is ok, k = double (sqrt ((double) m)); At this point, k is declared as double, which is easier.