#include <iostream>
using namespace std;
int main()
{
int N;
do
{
cout<<"N(1..12)=";
cin>>N;
}
while(N<1 || N>12);
for(int row=0;row<=N;row++)
{
for(int col=0;col<39-row;col++)
cout<<" ";
for(int col=0;col<2*row+1;col++)
cout<<"*";
cout<<endl;
}
for(int row=N-1;row>=0;row--)
{
for(int col=0;col<39-row;col++)
cout<<" ";
for(int col=0;col<2*row+1;col++)
cout<<"*";
cout<<endl;
}
return 0;
}
#include <iostream>
using namespace std;
int main()
{
double x, y, d1sq, d2sq, d3sq;
cin >> x >> y;
d1sq = x * x + (y - 3.0d) * (y - 3.0d);
d2sq = x * x + (y + 3.0d) * (y + 3.0d);
d3sq = x * x + y * y;
if (d3sq > 6.0d * 6.0d)
cout << "Outside";
else if (d3sq == 6.0d * 6.0d)
cout << "Undefined";
else if (d1sq < 1.0d)
cout << "Black";
else if (d1sq == 1.0d)
cout << "Undefined";
else if (d2sq < 1.0d)
cout << "White";
else if (d2sq == 1.0d)
cout << "Undefined";
else if (d1sq < 3.0d * 3.0d)
cout << "White";
else if (d1sq == 3.0d * 3.0d && x >= 0.0d)
cout << "Undefined";
else if (d2sq < 3.0d * 3.0d)
cout << "Black";
else if (d2sq == 3.0d * 3.0d && x <= 0.0d)
cout << "Undefined";
else if (x > 0.0d)
cout << "Black";
else
cout << "White";
cout << endl << endl;
return 0;
}
Регистрирани потребители: Google Adsense [Bot], Google [Bot]