-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path2022-03-23.cpp
More file actions
59 lines (50 loc) · 898 Bytes
/
2022-03-23.cpp
File metadata and controls
59 lines (50 loc) · 898 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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#include <iostream>
using namespace std;
void P2(int arr[100]);
void P3(int arr[100]);
void PrintArr(int arr[100]);
// 1´Ü°è¸¸ ÇØ°á
int main() {
int arr[100] = { 0, };
}
void PrintArr(int arr[100]) {
for (int i = 0; i < 100; i++) {
if (arr[i] != 0) {
cout << arr[i] << " ";
}
if (i % 10 == 9) {
cout << endl;
}
}
}
void P3(int arr[100]) {
}
void P2_2(int arr[100]) {
int i1, i2;
for (int i = 0; i < 100; i++) {
i1 = i / 10;
i2 = i % 10;
if ((i1 * 10 + i2) % 10 == 0) {
arr[i1 * 10 + i2] = 1;
cout << endl;
}
else if (i1 > 0) {
arr[i1 * 10 + i2] = arr[(i1 - 1) * 10 + i2] + arr[(i1 - 1) * 10 + (i2 - 1)];
}
if (arr[i] != 0)
{
cout << arr[i] << " ";
}
}
}
void P2_1(int arr[100]) {
for (int i = 0; i < 100; i++) {
if (i % 10 == 0) {
arr[i] = 1;
}
else if (i >= 11) {
arr[i] = arr[i - 10] + arr[i - 11];
}
}
PrintArr(arr);
}