" Life is not a problem to be solved but a reality to be experienced! "
© Copyright 2013 - 2024 KUDO.TIPS - All rights reserved.
#include <cstdlib>
using namespace std;
int main ()
{
int n = 2;
int m = 1;
int os = (3+m)*n;
//kapelusz gora
for (int i = 0; i < n; i++)
{
for (int j = (-1)*os; j <= os; j++)
if (abs(j) < 2*n) cout << "*"; else cout << " ";
cout << endl;
}
//kapelusz rondo
for (int i = 0; i < n; i++)
{
for (int j = (-1)*os; j <= os; j++)
if (abs(j) < 3*n) cout << "*"; else cout << " ";
cout << endl;
}
//glowa
for (int i = 2*n; i >= -2*n; i--)
{
if (i > n) continue; //sciecie gorne
if (i == -2*n) continue; //sciety dolny punkt
for (int j = (-1)*os; j <= os; j++)
if (j == 0 && i == -1 * n) cout << "-"; //usta
else
if (i == n/2 && abs(j) == n/2 + 1) cout << "O"; //oczy
else
if (i*i + j*j <= 2*n*2*n) cout << "*"; //twarz
else cout << " ";
cout << endl;
}
//tulow z szalikiem
for (int i = 3*n ; i >= -3 * n; i--)
{
if (i == 3*n) continue; //sciecie gorne
if (i == -3*n) continue; //sciecie dolne
for (int j = (-1)*os; j <= os; j++)
if (i*i + j*j <= 3*n*3*n)
if (i == 0 && j == 0) cout << "X"; //guzik
else if (i > abs(j)) cout << "|"; //szalik
else cout << "*"; //twarz
else cout << " ";
cout << endl;
}
//dodatkowe kule
for (int kula = 0; kula < m; kula++)
{
for (int i=(kula+4) * n; i >= -1 * (kula+4) * n; i--)
{
if (i == (kula+4) * n) continue; //sciecie do gory
if (i == -1 * (kula+4) * n) continue; //sciecie od dolu
for (int j = (-1)*os; j <= os; j++)
if (i == 0 && j == 0) cout << "X";
else
if (i*i + j*j <= (kula+4) * n * (kula+4) * n) cout << "*";
else cout << " ";
cout << endl;
}
}
return 0;
}