Advertisement
DidiMilikina

06. Square of Stars

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