69,382
社区成员
发帖
与我相关
我的任务
分享
#include <iostream>
using namespace std;
const unsigned int R=10;
int main()
{
for(int x=0;x<2*R;++x)
{
for(int y=0;y<2*R;++y)
{
if((x-R)*(x-R)+(y-R)*(y-R)<=R*R)
cout<<"*";
else
cout<<" ";
}
cout<<endl;
}
return 0;
}
#include <iostream>
using namespace std;
const unsigned int R=35;
int main()
{
for (int x=0;x<=2*R;++x)
{
int pr=(x-R)*(x-R);
for (int y=0;y<=2*R;++y)
{
if (pr+(y-R)*(y-R)<=R*R)
cout<<" ";
else
cout<<"*";
}
cout<<endl;
}
return 0;
}