Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- int n, i;
- cin >> n;
- for (int k = 1; k <= n; k++)
- {
- for (int j = 1; j <= n; j++)
- {
- if (k == n || k == 1)
- {
- cout << "*";
- }
- else
- {
- if (j == 1 || j == n)
- {
- cout << "*";
- }
- else cout << " ";
- }
- }
- cout << "\n";
- }
- }
- //for (int i = 0; i <= n; i++)
- //{
- // cout << "*";
- // int n, i;
- // cin >> n;
- // for (int k = 0; k <= n; k++)
- // {
- // cout << "*";
- // }
- // cout << "\n";
- // /*if (k = n || k == 1)
- // {
- //cout */
- // for (i = 0; i < n - 2; i++)
- // {
- // for (int j = 0; i <= n; j++)
- // {
- // if (j == n || j == 0)
- // {
- // cout << "*";
- // }
- // else
- // {
- // cout << " ";
- // }
- // cout << "\n";
- // }
- // for (int j = 0; i <= n; j++)
- // {
- // cout << "*";
- // }
- //
- // }
- //
- // /*else
- // {
- // cout << "*";
- // }
- // cout << "\n";
- // */
- //
- // return 0;
- //}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement