Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- const int n = 80;
- void f(char c, int a) {
- for (int i = 0; i < a; ++i) {
- cout << "*";
- }
- for (int i = 0; i < n - 2 * a; ++i) {
- cout << c;
- }
- for (int i = 0; i < a; ++i) {
- cout << "*";
- }
- cout << endl;
- if (c == 'Z') {
- return;
- }
- f(++c, ++a);
- for (int i = 0; i < a - 1; ++i) {
- cout << "*";
- }
- for (int i = 0; i < n - 2 * (a - 1); ++i) {
- cout << (char) (c - 1);
- }
- for (int i = 0; i < a - 1; ++i) {
- cout << "*";
- }
- cout << endl;
- }
- int main() {
- int a = 0;
- char c = 'A';
- f(c, a);
- cout << endl;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement