#include <iostream>
void print_letters(int letters, int limit)
{
for (int i = 0; i < (limit - letters) / 2; i++)
{
std::cout << ' ';
}
for (int i = 0; i < letters; i++)
{
std::cout << char(i + 'A');
}
std::cout << std::endl;
}
void recursion_rocks(int letters, int limit)
{
print_letters(letters, limit);
if (letters != limit)
{
recursion_rocks(letters + 2, limit);
print_letters(letters, limit);
}
}
int main()
{
std::cout << "Enter an odd number:" << std::endl;
int number;
std::cin >> number;
recursion_rocks(1, number);
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgoKdm9pZCBwcmludF9sZXR0ZXJzKGludCBsZXR0ZXJzLCBpbnQgbGltaXQpCnsKICAgIGZvciAoaW50IGkgPSAwOyBpIDwgKGxpbWl0IC0gbGV0dGVycykgLyAyOyBpKyspCiAgICB7CiAgICAgICAgc3RkOjpjb3V0IDw8ICcgJzsKICAgIH0KCiAgICBmb3IgKGludCBpID0gMDsgaSA8IGxldHRlcnM7IGkrKykKICAgIHsKICAgICAgICBzdGQ6OmNvdXQgPDwgY2hhcihpICsgJ0EnKTsKICAgIH0KCiAgICBzdGQ6OmNvdXQgPDwgc3RkOjplbmRsOwp9Cgp2b2lkIHJlY3Vyc2lvbl9yb2NrcyhpbnQgbGV0dGVycywgaW50IGxpbWl0KQp7CiAgICBwcmludF9sZXR0ZXJzKGxldHRlcnMsIGxpbWl0KTsKCiAgICBpZiAobGV0dGVycyAhPSBsaW1pdCkKICAgIHsKICAgICAgICByZWN1cnNpb25fcm9ja3MobGV0dGVycyArIDIsIGxpbWl0KTsKICAgICAgICBwcmludF9sZXR0ZXJzKGxldHRlcnMsIGxpbWl0KTsKICAgIH0KfQoKaW50IG1haW4oKQp7CiAgICBzdGQ6OmNvdXQgPDwgIkVudGVyIGFuIG9kZCBudW1iZXI6IiA8PCBzdGQ6OmVuZGw7CiAgICBpbnQgbnVtYmVyOwogICAgc3RkOjpjaW4gPj4gbnVtYmVyOwoKICAgIHJlY3Vyc2lvbl9yb2NrcygxLCBudW1iZXIpOwoKICAgIHJldHVybiAwOwp9