Untitled

mail@pastecode.io avatar
unknown
plain_text
7 months ago
650 B
2
Indexable
Never
#include <iostream>
using namespace std;
int main()
{
    char mas[100][100];
    int n, m;
    cin >> n >> m;
    for (int i = 0; i < n; i++)
    {
        for (int j = 0; j < n; j++)
        {
            if (i < (n - m)/2 || i >= n - (n -m)/2 || j < (n - m) / 2 || j >= n - (n - m) / 2)
            {
                mas[i][j] = '@';
            }
            else
            {
                mas[i][j] = ' ';
            }
        }
    }
    for (int i = 0; i < n; i++)
    {
        for (int j = 0; j < n; j++)
        {
            cout << " " << mas[i][j];
        }
        cout << endl;
    }
    return 0;
}
Leave a Comment