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