55
版主
#include<bits\stdc++.h> #include<cmath> using namespace std; int main(){ int R; int e=0,r; double x,y,z; cin>>R; for(int i=1;i<R;i++){ for(int j=1;j<R;j++){ r=i*i+j*j; z=pow(r,0.5); if(z==int(z)&&z<=R){ e=e+1; } } } e=e/2; cout<<e; return 0; }
使用道具 举报
|小黑屋|山东智趣岛论坛 ( 鲁ICP备2023024048号 )
GMT+8, 2025-4-22 06:11 , Processed in 0.185611 second(s), 37 queries .
Powered by Discuz! X3.3 Licensed
Copyright © 2001-2020, Tencent Cloud.