Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //
- // main.cpp
- // STRATEGY
- //
- // Created by Андрей Москалёв on 17.01.17.
- // Copyright © 2017 Андрей Москалёв. All rights reserved.
- //
- #include <iostream>
- using namespace std;
- int main(int argc, const char * argv[]) {
- int n;
- cin >> n;
- int x[n][n];
- for (int i = 0; i < n; ++i) {
- for (int j = 0; j < n; ++j) {
- if (i + j == n - 1) x[i][j] = 1;
- else if (i + j < n) x[i][j] = 0;
- else x[i][j] = 2;
- }
- }
- for (int i = 0; i < n; ++i) {
- for (int j = 0; j < n; ++j) {
- cout << x[i][j] << ' ';
- }
- cout << endl;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement