Advertisement
Guest User

Untitled

a guest
Nov 15th, 2018
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.88 KB | None | 0 0
  1. #include<iostream>
  2. using namespace std;
  3. int main() {
  4. char c;
  5. int n;
  6. cin >> n >> c;
  7. int redove = (26 - 2 * n) / 2;
  8. for (int i = 0; i < redove; i++) {
  9. cout << endl;
  10. }
  11. int koloni = (81 - 2 * n) / 2;
  12. for (int i = 1; i < n; i++) {
  13. for (int i = 0; i < koloni; i++) {
  14. cout << " ";
  15. }
  16. for (int j = 0; j < n - i; j++) {
  17. cout << " ";
  18. }
  19. for (int j = 0; j < i; j++) {
  20. cout << c << " ";
  21. }
  22. cout << endl;
  23. }
  24. for (int i = 0; i < koloni; i++) {
  25. cout << " ";
  26. }
  27. for (int i = 0; i < n; i++) {
  28. cout << c << " ";
  29. }
  30. cout << endl;
  31. for (int i = 1; i < n; i++) {
  32. for (int i = 0; i < koloni; i++) {
  33. cout << " ";
  34. }
  35. for (int j = 0; j < i; j++) {
  36. cout << " ";
  37. }
  38. for (int j = 0; j < n - i; j++) {
  39. cout << c << " ";
  40. }
  41. cout << endl;
  42. }
  43. for (int i = 0; i < redove; i++) {
  44. cout << endl;
  45. }
  46. system("pause");
  47. return 0;
  48. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement