DavidNorgren

Untitled

Sep 25th, 2015
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.23 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 * n; i++) cout << ((i / n == i % n || i / n == n - 1 - i % n) ? "*" : " ") << ((i % n == n - 1) ? "\n" : "");
  9.  
  10.     return 0;
  11. }
Advertisement
Add Comment
Please, Sign In to add comment