eolymp
bolt
Try our new interface for solving problems
published at 3/4/14, 1:57:47 pm

Всем привет!

published at 3/4/14, 1:59:20 pm

...

published at 3/4/14, 2:01:17 pm

чта?

published at 1/4/24, 10:57:53 am

include <bits/stdc++.h>

using namespace std;

int main() { iosbase::syncwith_stdio(0); cin.tie(0); cout.tie(0);

int n;
cin>>n;
for(int i = 0; i < n; i++){
    for(int j = 0; j < n; j++){
        if(i + j + 1 < n){
            cout << 2;
        }else if(i + j + 1 == n){
            cout << 0;
        }else{
            cout << 1;
        }
    }
    cout << '\n';
}

}

published at 1/16/24, 1:30:42 pm

python:

n = int(input()) for i in range(0,n): for j in range(0,n): if i+j == n-1: print(0, end = '') elif i+j < n-1: print(2, end = '') else: print(1, end = '') print('')