Advertisement
Guest User

KURWA ALE SIE Z TYM MECZYŁEM XD

a guest
Oct 21st, 2019
167
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.68 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3. #define SIZE 15
  4.  
  5. int main()
  6. {
  7. int a = SIZE, j, i, m = 0, k = 0;
  8. char tab[SIZE][SIZE];
  9. for (a; a > SIZE / 2; a -= 2)
  10. {
  11. for (i = m; i < a; i++)
  12. {
  13. for (j = k; j < a; j++)
  14. {
  15. tab[i][j] = (i + a == SIZE || j + a == SIZE || j == a - 1 || i == a - 1) ? '*' : ' ';
  16. if ((i < SIZE / 2 && j < SIZE / 2) && (i - 1 == j&& i%2==1))
  17. {
  18. tab[i][j] = ' ';
  19. }
  20. else if ((i < SIZE / 2 && j < SIZE / 2) && i-1==j && i%2==0)
  21. {
  22. tab[i][j] = '*';
  23. }
  24. }
  25. }
  26. m += 2;
  27. k += 2;
  28. }
  29. for (i = 0; i < SIZE; i++)
  30. {
  31. for (j = 0; j < SIZE; j++)
  32. {
  33. cout << tab[i][j] << ' ';
  34. }
  35. cout << endl;
  36. }
  37. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement