Untitled

mail@pastecode.io avatar
unknown
plain_text
2 years ago
550 B
2
Indexable
Never
#include <iostream>
using namespace std;
int main() {
    char a, b;
    int x, y;
    cout << "Input first character,second character and size of rectangle (a b x y)" << endl;
    cin >> a >> b >> x >> y;
    for (int i = 0; i < x; i++){
        cout << a << ' ';
    }
    cout << endl;
    for (int i = 0; i < y-2; i++){
        cout << a << ' ';
        for (int j = 0; j < x-2; j++){
            cout << b << ' ';
        }
        cout << a << endl;
    }
    for (int i = 0; i < x; i++) {
        cout << a << ' ';
    }
}