ФІО = Батарчук КОД Запитання:namespace Parameters { class Program { static int D1 = 50; static int D2 = 70; static int Result; static int[] A = { 1, 2, 3, 4, 5 }; //-- static void Main(string[] args) { Test tst = new Test(); // Повернення скалярного результату через значення методу Result = tst.F2(5, D2 + 2); // Передача складних даних Result = tst.F3(A); // Повернення складних даних через значення методу MyS S = tst.F4(A); MyC C = tst.F5(A); } } //--------------------------------------------------- class Test { public int T1 = 10; static int T2 = 20; public int Accum; //-- public void F1(int Argument_1) { Accum = Argument_1 * T1; } //-- public int F2(int Argument_1, int Argument_2) { Accum = Argument_1 + Argument_2; return Argument_1 * 1000 + Argument_2; } //-- public int F3(int[] Argument_1) { int S = 0; foreach (int A in Argument_1) S += A; return S; } //-- public MyS F4(int[] Argument_1) { MyS S; S.I = 0; foreach (int A in Argument_1) S.I += A; S.D = S.I / 5.0; return S; } //-- public MyC F5(int[] Argument_1) { MyC C = new MyC(); C.I = 0; foreach (int A in Argument_1) C.I += A; C.D = C.I / 5.0; return C; } //-- public void F6(int[] Argument_1) { int Len = Argument_1.Length; for (int N = 0; N < Len; N++) Argument_1[N]++; } //-- public void F7( MyS Argument_1, MyC Argument_2) { Argument_1.I++; Argument_2.I++; } //-- public void F8(ref MyS Argument_1, MyC Argument_2) { Argument_1.I++; Argument_2.I++; } //-- public void F9(out MyS Argument_1, MyC Argument_2) { Argument_1.I = Argument_2.I*100; Argument_1.D = Argument_2.D*100; } //-- } //---------------------------- struct MyS { public int I; public double D; } //---------------------------- class MyC { public int I; public double D; } //--- } ==================================== ANSWER ==================================== //-- public MyC F5(int[] Argument_1) // Обявляем "функцию" с именем F5, которая будет возвращать даные типа MyC; Функция принимает масив интов. { MyC C = new MyC(); // Создаем переменную с именем C типа MyC. C.I = 0; Поле I в переменной C "=" 0 foreach (int A in Argument_1)// Прогоняем по всем елементам массива Argument_1 C.I += A; // C.I=C.I + текущее значение елемента масива Argument_1 C.D = C.I / 5.0; return C; // Возвращаем даные класса MyC } //-- END of ANSWER ====================================