bdfs无果
#include<bits/stdc++.h>
#include<windows.h>
using namespace std;
int main()
{
int ansx=0,ansy=0,ansz=0;
double ans=114514;
for(int x=0;x<=50;x++)
for(int y=0;y<=50;y++)
for(int z=0;z<=50;z++)
{
// cout<<x<<" "<<y<<" "<<z;
double dis=ceil(sqrt((x)*(x)+(y)*(y)+(z)*(z)));
// cout<<"差距:"<<ans<<endl;
if(abs(41-dis)<abs(41-ans)) ansx=x,ansy=y,ansz=z,ans=dis,cout<<ansx<<" "<<ansy<<" "<<ansz<<endl;
}
cout<<ansx<<" "<<ansy<<" "<<ansz<<" ";
return 0;
}
有大佬帮忙康康代码错在哪里啊啊啊