-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbrutacsharp.cs
More file actions
202 lines (185 loc) · 17.9 KB
/
brutacsharp.cs
File metadata and controls
202 lines (185 loc) · 17.9 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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
public class App
{
static void Main(string[] args)
{
DateTime time = DateTime.Now;
int n1 = 0, n2 = 0, n3 = 0, n4 = 0, n5 = 0, n6 = 0, n7 = 0, n8 = 0, n9 = 0, n10 = 0, n11 = 0, n12 = 0, n13 = 0, n14 = 0, n15 = 0, n16 = 0, n17 = 0, n18 = 0, n19 = 0;
List<int> numbers = new List<int> { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19 };
List<int> c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, c13, c14, c15, c16, c17, c18, c19;
c1 = new List<int> { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19 };
for (int x1 = 0; x1 < c1.Count; x1++ )
{
n1 = c1[x1];
c2 = c1.Select(i => i).ToList();
c2.Remove(n1);
for (int x2 = 0; x2 < c2.Count; x2++)
{
n2 = c2[x2];
c3 = c2;
c3 = c2.Select(i => i).ToList();
c3.Remove(n2);
for (int x3 = 0; x3 < c3.Count; x3++)
{
n3 = c3[x3];
if (n1 + n2 + n3 == 38)
{
c4 = c3.Select(i => i).ToList();
c4.Remove(n3);
for (int x4 = 0; x4 < c4.Count; x4++)
{
n4 = c4[x4];
c5 = c4.Select(i => i).ToList();
c5.Remove(n4);
for (int x5 = 0; x5 < c5.Count; x5++)
{
n5 = c5[x5];
c6 = c5.Select(i => i).ToList();
c6.Remove(n5);
for (int x6 = 0; x6 < c6.Count; x6++)
{
n6 = c6[x6];
c7 = c6.Select(i => i).ToList();
c7.Remove(n6);
for (int x7 = 0; x7 < c7.Count; x7++)
{
n7 = c7[x7];
if(n4 + n5 + n6 + n7 == 38)
{
c8 = c7.Select(i => i).ToList();
c8.Remove(n7);
for (int x8 = 0; x8 < c8.Count; x8++)
{
n8 = c8[x8];
if(n1 + n4 + n8 == 38)
{
c9 = c8.Select(i => i).ToList();
c9.Remove(n8);
for (int x9 = 0; x9 < c9.Count; x9++)
{
n9 = c9[x9];
c10 = c9.Select(i => i).ToList();
c10.Remove(n9);
for (int x10 = 0; x10 < c10.Count; x10++)
{
n10 = c10[x10];
c11 = c10.Select(i => i).ToList();
c11.Remove(n10);
for (int x11 = 0; x11 < c11.Count; x11++)
{
n11 = c11[x11];
c12 = c11.Select(i => i).ToList();
c12.Remove(n11);
for (int x12 = 0; x12 < c12.Count; x12++)
{
n12 = c12[x12];
if(n8 + n9 + n10 + n11 + n12 == 38)
{
if(n3 + n7 + n12 == 38)
{
c13 = c12.Select(i => i).ToList();
c13.Remove(n12);
for (int x13 = 0; x13 < c13.Count; x13++)
{
n13 = c13[x13];
if (n2 + n5 + n9 + n13 == 38)
{
c14 = c13.Select(i => i).ToList();
c14.Remove(n13);
for (int x14 = 0; x14 < c14.Count; x14++)
{
n14 = c14[x14];
c15 = c14.Select(i => i).ToList();
c15.Remove(n14);
for (int x15 = 0; x15 < c15.Count; x15++)
{
n15 = c15[x15];
c16 = c15.Select(i => i).ToList();
c16.Remove(n15);
for (int x16 = 0; x16 < c16.Count; x16++)
{
n16 = c16[x16];
if (n13 + n14 + n15 + n16 == 38)
{
if (n2 + n6 + n11 + n16 == 38)
{
c17 = c16.Select(i => i).ToList();
c17.Remove(n16);
for (int x17 = 0; x17 < c17.Count; x17++)
{
n17 = c17[x17];
if (n3 + n6 + n10 + n14 + n17 == 38)
{
c18 = c17.Select(i => i).ToList();
c18.Remove(n17);
for (int x18 = 0; x18 < c18.Count; x18++)
{
n18 = c18[x18];
if (n4 + n9 + n14 + n18 == 38)
{
if (n7 + n11 + n15 + n18 == 38)
{
c19 = c18.Select(i => i).ToList();
c19.Remove(n18);
n19 = c19[0];
if(n17 + n18 + n19 == 38)
{
if(n1 + n5 + n10 + n15 + n19 == 38)
{
if(n12 + n16 + n19 == 38)
{
Console.Out.WriteLine("Success");
Console.Out.WriteLine(n1);
Console.Out.WriteLine(n2);
Console.Out.WriteLine(n3);
Console.Out.WriteLine(n4);
Console.Out.WriteLine(n5);
Console.Out.WriteLine(n6);
Console.Out.WriteLine(n7);
Console.Out.WriteLine(n8);
Console.Out.WriteLine(n9);
Console.Out.WriteLine(n10);
Console.Out.WriteLine(n11);
Console.Out.WriteLine(n12);
Console.Out.WriteLine(n13);
Console.Out.WriteLine(n14);
Console.Out.WriteLine(n15);
Console.Out.WriteLine(n16);
Console.Out.WriteLine(n17);
Console.Out.WriteLine(n18);
Console.Out.WriteLine(n19);
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
Console.Out.WriteLine(DateTime.Now - time);
Console.In.Read();
}
}