Untitled

mail@pastecode.io avatar
unknown
plain_text
2 years ago
452 B
0
Indexable
Never
#include <iostream> 
using namespace std;
int main() {
	char mas[100][100];
	int a, b,c;
	cin >> a >> b;
	c = a / 2 - b / 2;
	for (int i = 0; i < a; i++) {
		for (int j = 0; j < a; j++) {
			mas[i][j] = '*';
		}
	}
	for (int i = c; i < c + b; i++) {
		for (int j = c; j < c + b; j++) {
			mas[i][j] = ' ';
		}
	}
	for (int i = 0; i < a; i++) {
		for (int j = 0; j < a; j++) {
			cout << mas[i][j] << ' ';
		}
		cout << '\n';
	}
}