-
-
Notifications
You must be signed in to change notification settings - Fork 81
Expand file tree
/
Copy patharray_123.cpp
More file actions
38 lines (30 loc) · 629 Bytes
/
Copy patharray_123.cpp
File metadata and controls
38 lines (30 loc) · 629 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
// https://www.urionlinejudge.com.br/judge/en/problems/view/1534
#include <iostream>
#include <vector>
#include <string>
using namespace std;
int main() {
int n, one, two;
while (cin >> n) {
vector<string> numbers;
string num;
one = 0;
two = n-1;
for (int i = 0; i < n; i++) {
num = "";
for (int j = 0; j < n; j++) {
if (one == j && one == two) num += "2";
else if (one == j) num += "1";
else if (two == j) num += "2";
else num += "3";
}
one++;
two--;
numbers.push_back(num);
}
for (int i = 0; i < numbers.size(); i++) {
cout << numbers[i] << endl;
}
}
return 0;
}