Advertisement
myloyo

8.3.14

Mar 2nd, 2023 (edited)
144
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.60 KB | None | 0 0
  1. #include <iostream>
  2. #include <string>
  3.  
  4. using namespace std;
  5.  
  6. void vivod(int n, char a) {
  7.     for (int i = 1; i <= n; ++i) {
  8.         cout << a;
  9.     }
  10. }
  11.  
  12. void F(int i, int n, int k) {
  13.     if (k == 90) {
  14.         vivod(i, ' ');
  15.         vivod(n, (char)k);
  16.         vivod(i, ' ');
  17.         cout << endl;
  18.     }
  19.     if (k < 90) {
  20.         vivod(i, ' ');
  21.         vivod(n, (char)k);
  22.         vivod(i, ' ');
  23.         cout << endl;
  24.         F(i + 1, n - 2, k + 1);
  25.         vivod(i, ' ');
  26.         vivod(n, (char)k);
  27.         vivod(i, ' ');
  28.         cout << endl;
  29.     }
  30. }
  31.  
  32. int main() {
  33.     F(0, 80, 65);
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement