oj上的编译器严格一点
判断的时候用 tmp == (int)tmp 不大行
用的tmp == (floor)tmp 效果一样
class Solution { public: int a[100100]; bool judgeSquareSum(int c) { long long i; for(i = 0; i < 100100 && i * i < INT_MAX; i++) a[i] = i * i; i--; for(; i >= 0; i--) { double tmp = sqrt((double)(c - a[i])); if(tmp == (floor)(tmp)) { return 1; } } return 0; } };