using System using System Collections Generic using System Linq using

 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
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConsoleApplication1
{
internal interface leftSort
{
void result(int a);
}
internal interface rightSort
{
void result(int a);
myClass4 push(myClass4 a);
}
class myClass4: leftSort, rightSort
{
private int[] m;
public myClass4 (int[] x)
{
this.m = new int[x.Length];
this.m = x;
}
myClass4 rightSort.push(myClass4 a)
{
int[] tek = new int[m.Length + a.m.Length];
//tek = m;
for (int i = m.Length; i < m.Length + a.m.Length; i++)
{
tek[i] = a.m[i - m.Length];
}
myClass4 ans = new myClass4(tek);
return ans;
}
void leftSort.result(int n)
{
for (int i = 0; i < n; i++)
{
int mini = i;
for (int j = i; j < n; j++)
{
if (this.m[j] < this.m[mini])
{
mini = j;
}
}
int qwe = this.m[i];
this.m[i] = this.m[mini];
this.m[mini] = qwe;
}
}
void rightSort.result(int n)
{
for (int i = this.m.Length - n; i < this.m.Length; i++)
{
int mini = i;
for (int j = i; j < this.m.Length; j++)
{
if (this.m[j] < this.m[mini])
{
mini = j;
}
}
int qwe = this.m[i];
this.m[i] = this.m[mini];
this.m[mini] = qwe;
}
}
}
class Program
{
static void Main(string[] args)
{
int[] a = new int[8] { 1, 34, 2, 3, 45, 2, 3, 6 };
leftSort qwe = new myClass4(a);
qwe.result(4);
rightSort qwe1 = new myClass4(a);
rightSort qwe2 = new myClass4(a);
myClass4 qwe3 = new myClass4(a);
qwe2.push(qwe3);
qwe1.result(4);
int rty;
}
}
}