Repository navigation
Expand file tree
/
Copy pathsource.cpp
More file actions
82 lines (79 loc) · 1.91 KB
/
Copy pathsource.cpp
File metadata and controls
82 lines (79 loc) · 1.91 KB
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
#include <iostream>
#include "tex.h"
using namespace std;
int main() {
tex a,b, e;
a.input();
b.input();
tex n[5][5];
tex t[10];
t[1] = a;
t[2] = b;
t[3] = a*a;
t[4] = b*b;
t[5] = a*b;
t[6] = b*a;
for(int i = 1;i < 7; ++i) {
int k = 1;
while(k < 4) {
if(t[i].a[k] == k)
k++;
else if(n[k][t[i].a[k]] == e) {
n[k][t[i].a[k]] = t[i];
break;
}
else {
t[i] = t[i] * n[k][t[i].a[k]].hakadardz();
k++;
}
}
}
int count = 1;
for(int i = 1;i < 4; ++i) {
for(int j = i + 1; j <= 4; ++j) {
if(n[i][j]!=e) {
t[count++] = n[i][j];
}
}
}
if(count != 7) {
bool newItem = true;
while(newItem) {
newItem = false;
for(int i = 1;i < count; ++i) {
for(int j = 1; j < count; ++j) {
tex t0 = t[i]*t[j];
int k = 1;
while(k < 4) {
if(t0.a[k] == k)
k++;
else if(n[k][t0.a[k]] == e) {
n[k][t0.a[k]] = t0;
newItem = true;
break;
}
else {
t0 = t0 * (n[k][t0.a[k]].hakadardz());
k++;
}
}
}
}
}
}
for(int i = 1;i <= 4; ++i) {
cout<<endl;
for(int j = 1;j <= 4; ++j) {
e.print();
}
cout<<endl;
for(int j = 1;j <= 4; ++j) {
n[i][j].print();
}
cout<<endl;
for(int j = 1;j <= 43; ++j)
cout<<'-';
}
cout<<endl;
return 0;
}