DavidNorgren

Untitled

Sep 25th, 2015
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.24 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main() {
  6.     int n;
  7.     cin >> n;
  8.     for (int i = 0; i < n; i++)
  9.         for (int j = 0; j < n; j++)
  10.             cout << ((i == j || i == n - 1 - j) ? "*" : " ") << ((j == n - 1) ? "\n" : "");
  11.  
  12.     return 0;
  13. }
Advertisement
Add Comment
Please, Sign In to add comment