9Вариант
namespace Variant_9
{
class nine
{
int x, y, z;
public nine(int x, int y, int z)
{
this.x = x;
this.y = y;
this.z = z;
}
int Min(int x, int y)
{
if (x < y) return x;
return y;
}
int Max(int x, int y)
{
if (x > y) return x;
return y;
}
public double Solution()
{
int Summa = x + y + z;
int Proizvedenie = x * y * z;
int SummaXY = x + y;
int ProizvedenieYZ = y * z;
double Solution = Max((Summa), (Proizvedenie)) / Min((SummaXY), (ProizvedenieYZ));
return Solution;
}
}
class Program
{
static void Main(string[] args)
{
}
}
}
10Вариант
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace DkR
{
class Abc
{
public int x,y,z,k1,k2,min,max;
public Abc(int x,int y,int z,int k1,int k2)
{
this.x = x;
this.y = y;
this.z = z;
this.k1 = k1;
this.k2 = k2;
}
public void minimum()
{
if (k1 > k2)
{
min = k2;
max = k1;
}
else
{
min = k1;
max = k2;
}
// r=max * (min * (x * x * y) * z);
}
public int r
{
get { return max * (min * (x * x * y) * z); }
}
}
class Program
{
static void Main(string[] args)
{
Abc a = new Abc(2, 1, 2, 3, 4);
a.minimum();
Console.WriteLine("Min =" + a.min + " Max=" + a.max + " r=" + a.r);
Console.ReadKey();
}
}
}
28Вариант
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConsoleApplication2
{
class Arr
{
int z,x,c;
int k=-100;
public void Print (int[] arr)
{
foreach (int a in arr)
{
Console.Write("\t"+a);
c++;
if (a < 0) z++;
}
Console.WriteLine("\nКоличество отрицательных элементов {0}",z);
for (int i = 0; i < c; i++)
{
if (arr[i] > k) { k = arr[i]; x = i; }
}
Console.WriteLine("Максимальный элемент расположен по позиции {0}", x+1);
}
}
class Program
{
static void Main(string[] args)
{
int[] ar = new int[5]{1,2,-3,4,5};
Arr a = new Arr();
a.Print(ar);
Console.ReadKey();
}
}
}
25Вариант
namespace ConsoleApplication17
{
class kotoPoh
{
public void kot(int[,] dvumer)
{
int[] ar = new int[4];
for (int i = 0; i<4;i++)
{
for(int j = 0; j<4;j++)
{
if (i == j) ar[i] = dvumer[i, j];
}
Console.WriteLine("\t" + ar[i]);
}
Console.ReadKey();
}
}
class Program
{
static void Main(string[] args)
{
int[,] arr = new int[4, 4]{{1,0,0,0},{0,2,0,0},{0,0,3,0},{0,0,0,4}};
kotoPoh a = new kotoPoh();
a.kot(arr);
}
}
}