Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include "iostream"
- #include "iomanip"
- #include <iso646.h>
- using namespace std;
- int main()
- {
- int m,n,i,j;
- cout << "Введите n и m: \n";
- cin >> n >> m;
- string a[n][m];
- for (i = 0; i< n; i++)
- for (j = 0; j < m; j++)
- {
- if (i != 0 and i != n-1)
- {
- a[i][0] = "*";
- a[i][m-1] = "*";
- }
- else
- a[i][j] = "*";
- }
- for (i=0; i<n; i++)
- {
- for (j=0; j<m; j++)
- {
- cout<<a[i][j]<<"\t";
- }
- cout<<endl;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement