MartinPaunov

SquareOfStars

Mar 11th, 2018
149
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.29 KB | None | 0 0
  1. #include <iostream>
  2. #include <string>
  3.  
  4. using namespace std;
  5.  
  6. int main()
  7. {
  8.     int n;
  9.  
  10.     cin >> n;
  11.  
  12.     cout << string(n, '*') << endl;
  13.  
  14.     for (size_t i = 0; i < n - 2; i++)
  15.     {
  16.         cout << ("*" + string(n - 2, ' ') + "*") << endl;
  17.     }
  18.  
  19.     cout << string(n, '*') << endl;
  20.    
  21.  
  22.     return 0;
  23. }
Advertisement
Add Comment
Please, Sign In to add comment