Advertisement
awsmpshk

Untitled

Mar 1st, 2020
164
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. const int n = 80;
  6.  
  7. void f(char c, int a) {
  8. for (int i = 0; i < a; ++i) {
  9. cout << "*";
  10. }
  11. for (int i = 0; i < n - 2 * a; ++i) {
  12. cout << c;
  13. }
  14. for (int i = 0; i < a; ++i) {
  15. cout << "*";
  16. }
  17. cout << endl;
  18. if (c == 'Z') {
  19. return;
  20. }
  21. f(++c, ++a);
  22. for (int i = 0; i < a - 1; ++i) {
  23. cout << "*";
  24. }
  25. for (int i = 0; i < n - 2 * (a - 1); ++i) {
  26. cout << (char) (c - 1);
  27. }
  28. for (int i = 0; i < a - 1; ++i) {
  29. cout << "*";
  30. }
  31. cout << endl;
  32. }
  33.  
  34. int main() {
  35. int a = 0;
  36. char c = 'A';
  37. f(c, a);
  38. cout << endl;
  39. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement