//只通过了70% #include<iostream> #include<math.h> using namespace std; int main(){ int n; while(cin >> n){ if(n < 1){ cout << 0 << endl; } else{ int r = sqrt(float(n)); int count = 0; for(int i = 1; i <= r; i++){ int x = sqrt(float(n - i * i)); if((i * i + x * x) == n){ count++; } } cout << 4*count << endl; } } return 0; } 大神,求指导这个代码为什么只通过70%,错在哪里?
点赞 评论

相关推荐

03-25 16:22
南华大学 Java
不敢追175女神:你是打了上千个招呼吧?😂
点赞 评论 收藏
分享
你背过凌晨4点的八股文么:简历挂了的话会是流程终止,像我一样
点赞 评论 收藏
分享
牛客网
牛客企业服务