int mySqrt(int x){ unsigned int i = 0; while(i * i < x) i++; if (i * i == x) return i; return --i; }