{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("Array13");
int x;
Array:
Console.Write("x=");
x = Convert.ToInt32(Console.ReadLine());
if (x % 2 == 0)
{
Console.WriteLine("toq son kiriting!");
goto Array;
}
int[] s = new int[x];
for(int i = 0; i < x; i++)
{
Console.Write("s[" + i + "]=");
s[i] = Convert.ToInt32(Console.ReadLine());
}
int r = 1;
for (int i = 0; i < (x/2)+1; i++)
{
Console.WriteLine("S["+x+"-"+r+"]="+s[x-r]);
r += 2;
}
}
}
}
using System;
namespace Amaliyot
{
class Program
{
static void Main(string[] args)
{
int n;
Console.Write("n:");
n = Convert.ToInt32(Console.ReadLine());
int[] a = new int[n];
for (int i = 0; i < n; i++)
{
Console.Write("a[" + i + "]=");
a[i] = Convert.ToInt32(Console.ReadLine());
}
int r = 0;
for (int i = 0; i < n; i++)
{
if (i != n - 1)
{
if (a[i] > a[i + 1])
{
r++;
}
}
else
{
r = r * 1;
}
}
int[] s = new int[r];
int q = 0;
for (int i = 0; i < a.Length; i++)
{
if (i != n - 1)
{
if (a[i] > a[i + 1])
{
s[q] = i;
q++;
}
}
else
{
r = r * 1;
}
}
Console.WriteLine();
for (int i = 0; i < r; i++)
{
Console.Write(s[i]+" ");
}
Console.WriteLine("sherigidan katta bolgan elementlarni soni:" + r);
}
}
}
using System;
namespace Amaliyot
{
class Program
{
static void Main(string[] args)
{
int[] a = new int[5];
for(int i = 0; i < 5; i++)
{
Console.Write("a[" + i + "]=");
a[i] = Convert.ToInt32(Console.ReadLine());
}
int[] b = new int[5];
for (int i = 0; i < 5; i++)
{
Console.Write("b[" + i + "]=");
b[i] = Convert.ToInt32(Console.ReadLine());
}
int[] c = new int[10];
if (a[0] < b[0])
{
int r = 0;
for (int i = 0; i < 10; i++)
{
if (i < 5)
{
c[i] = a[i];
}
else
{
c[i] = b[r];
r++;
}
}
}
if (a[0] > b[0])
{
int r = 0;
for (int i = 0; i < 10; i++)
{
if (i < 5)
{
c[i] = b[i];
}
else
{
c[i] = a[r];
r++;
}
}
}
for (int i = 0; i < 10; i++)
{
Console.WriteLine("c[" + i + "]="+c[i]);
}
}
}
}
using System;
using System.Collections;
namespace Amaliyot
{
class Program
{
static void Main(string[] args)
{
int n;
Console.Write("n=");
n = Convert.ToInt32(Console.ReadLine());
double[] a = new double[n];
for (int i = 0; i < a.Length; i++)
{
Console.Write("a[" + i + "]=");
a[i] = Convert.ToDouble(Console.ReadLine());
}
double[] b = new double[n];
for (int i = 0; i < a.Length; i++)
{
if (i != n - 1)
{
b[i] = (a[i] + a[i + 1]) / 2;
}
else
{
b[i] = a[i];
}
}
Console.WriteLine();
for (int i = 0; i < a.Length; i++)
{
Console.WriteLine("a[" + i + "]="+b[i]+" ");
}
}
}
}
’
using System;
namespace Amaliyot
{
class Program
{
static void Main(string[] args)
{
int n, k;
Console.Write("n=");
n = Convert.ToInt32(Console.ReadLine());
Console.Write("k=");
k = Convert.ToInt32(Console.ReadLine());
int[] a = new int[n];
for (int i = 0; i < a.Length; i++)
{
Console.Write("a[" + i + "]=");
a[i] = Convert.ToInt32(Console.ReadLine());
}
Console.WriteLine();
int[] b = new int[n + 1];
for (int i = 0; i < n + 1; i++)
{
if (i == k)
{
b[i] = 0;
}
else if (i < k)
{
b[i] = a[i];
}
else if (i > k && i != n)
{
b[i] = a[i - 1];
}
else if (i == n)
{
b[i] = a[n - 1];
}
}
for (int i = 0; i < b.Length; i++)
{
Console.Write("a[" + i + "]=" + b[i] + " ");
}
}
}
}
using System;
namespace Amaliyot
{
class Program
{
static void Main(string[] args)
{
int n;
Console.Write("n=");
n = Convert.ToInt32(Console.ReadLine());
int[] a = new int[n];
for (int i = 0; i < a.Length; i++)
{
Console.Write("a[" + i + "]=");
a[i] = Convert.ToInt32(Console.ReadLine());
}
Console.WriteLine();
int q = 0;
for (int i = 0; i < n; i++)
{
if (a[i] % 2 == 1)
{
q++;
}
}
int[] b = new int[n -q];
int r = 0;
for (int i = 0; i < n; i++)
{
if (a[i] % 2 == 1)
{
}
else
{
b[r] = a[i];
r++;
}
}
for (int i = 0; i < b.Length; i++)
{
Console.Write("a[" + i + "]=" + b[i] + " ");
}
}
}
}
using System;
namespace Amaliyot
{
class Program
{
static void Main(string[] args)
{
int n;
Console.Write("n=");
n = Convert.ToInt32(Console.ReadLine());
int[] a = new int[n];
for (int i = 0; i < a.Length; i++)
{
Console.Write("a[" + i + "]=");
a[i] = Convert.ToInt32(Console.ReadLine());
}
Console.WriteLine();
int max = 0;
int min = a[0];
int[] b=new int[n+2];
for (int i = 0; i < a.Length; i++)
{
if (max < a[i])
{
max = a[i];
}
}
for (int i = 0; i < a.Length; i++)
{
if (min > a[i])
{
min = a[i];
}
}
int j = 0;
for (int i = 0; i < a.Length; i++)
{
if (a[i] == max || a[i]==min)
{
b[j] = 0;
j++;
}
b[j] = a[i];
j++;
}
for (int i = 0; i < b.Length; i++)
{
Console.Write("a[" + i + "]=" + b[i] + " ");
}
}
}
}
using System;
namespace Amaliyot
{
class Program
{
static void Main(string[] args)
{
Console.Write("n=");
int n = Convert.ToInt32(Console.ReadLine());
Console.Write("k=");
int k = Convert.ToInt32(Console.ReadLine());
Console.Write("m=");
int m = Convert.ToInt32(Console.ReadLine());
int[] a = new int[n + m];
for (int i = 0; i < n; i++)
{
Console.Write("a["+i+"]=");
a[i] = Convert.ToInt32(Console.ReadLine());
}
for (int i = n - 1; i >= k; i--)
{
a[i + m] = a[i];
a[i] = 0;
}
n =n+m;
for (int i = 0; i < n; i++)
{
Console.Write("a["+i+"]="+a[i] + " ");
}
}
}
}
using System;
namespace Amaliyot
{
class Program
{
static void Main(string[] args)
{
int n;
Console.Write("n=");
n = Convert.ToInt32(Console.ReadLine());
int[] a = new int[n];
for (int i = 0; i < a.Length; i++)
{
Console.Write("a[" + i + "]=");
a[i] = Convert.ToInt32(Console.ReadLine());
}
for (int i = 0; i < n - 1; i++)
{
int min = i;
for (int j = i + 1; j < n; j++)
{
if (a[j] < a[min])
min = j;
}
int m = a[i];
a[i] = a[min];
a[min] = m;
}
for (int i = 0; i < a.Length; i++)
{
Console.Write("a[" + i + "]=" + a[i] + " ");
}
}
}
}
using System;
namespace Amaliyot
{
class Program
{
static void Main(string[] args)
{
int n;
Console.Write("n=");
n = Convert.ToInt32(Console.ReadLine());
int[] a = new int[n];
int[] b = new int[n];
for (int i = 0; i < n; i++)
{
Console.Write("x" + (i+1) + "=");
a[i] = Convert.ToInt32(Console.ReadLine());
Console.Write("y" + (i + 1) + "=");
b[i] = Convert.ToInt32(Console.ReadLine());
}
int max = 0;
int max1 = 0;
for (int i = 0; i < n; i++)
{
if (a[i] > 0 && b[i] > 0)
{
Console.WriteLine(a[i] + " bilan " + b[i] + " x va y nuqtalar 1-chorakda yotadi.");
}
else if (a[i] < 0 && b[i] < 0)
{
Console.WriteLine(a[i] + " bilan " + b[i] + " x va y nuqtalar 3-chorakda yotadi.");
}
if (Math.Abs(max) < Math.Abs(a[i]) && Math.Abs(max1) < Math.Abs(b[i]))
{
max = a[i];
max1 = b[i];
}
else if(max==0 && max1 == 0)
{
Console.WriteLine(0);
}
}
Console.WriteLine("markazdan eng uzoq nuqta= (" + max + "," + max1 + ")");
}
}
}
{
class Program
{
static void Main(string[] args)
{
int m;
Console.WriteLine("m=");
m = Convert.ToInt32(Console.ReadLine());
int[,] a = new int[m, m];
for (int i = 0; i < m; i++)
{
for (int j = 0; j < m; j++)
{
Console.Write("a[" + i + "," + j + "]=");
a[i, j] = Convert.ToInt32(Console.ReadLine());
}
}
int r = 0;
for (int s = 0; s < m; s++)
{
int[,] a1 = new int[m, m];
for (int i = 0 + r; i < m; i++)
{
for (int j = 0; j < m - r; j++)
{
if (i == r)
{
a1[i, j] = a[i, j];
}
if (j == m - r - 1)
{
a1[i, j] = a[i, j];
}
}
}
r++;
for (int i = 0; i < m; i++)
{
for (int j = 0; j < m; j++)
{
Console.Write(a1[i, j] + " ");
}
Console.WriteLine();
}
Console.WriteLine();
}
}
}
}
using System;
namespace Amaliyot
{
class Program
{
static void Main(string[] args)
{
int m;
Console.WriteLine("m=");
m = Convert.ToInt32(Console.ReadLine());
int n;
Console.WriteLine("n=");
n = Convert.ToInt32(Console.ReadLine());
int[,] a = new int[m, n];
for (int i = 0; i < m; i++)
{
for (int j = 0; j < n; j++)
{
Console.Write("a[" + i + "," + j + "]=");
a[i, j] = Convert.ToInt32(Console.ReadLine());
}
}
int r = 0;
int s1 = 0;
for (int s = 0; s < m; s++)
{
int[] a1 = new int[n];
for (int i = 0; i < m; i++)
{
for (int j = 0; j < n; j++)
{
if (j == r)
{
a1[i] = a[i, j];
}
}
}
for (int i = 0; i < n; i++)
{
s1 += a1[i];
}
int q = 0;
for (int i = 0; i < n; i++)
{
if (s1 / 3 < a1[i])
{
q++;
Console.WriteLine((r+1)+"-ustundagi shu ustun orta arifmetigidan katta son:"+a1[i]);
}
}
if (q == 0)
{
Console.WriteLine((r+1)+"-ustundagi shu ustun orta arifmetigidan katta son yoq!!!");
}
r++;
s1 = 0;
}
}
}
}
using System;
namespace Amaliyot
{
class Program
{
static void Main(string[] args)
{
int m;
Console.Write("m=");
m = Convert.ToInt32(Console.ReadLine());
int n;
Console.Write("n=");
n = Convert.ToInt32(Console.ReadLine());
int[,] a = new int[m, n];
int r = 0;
for (int i = 0; i < m; i++)
{
for (int j = n-1; j >= 0; j--)
{
Console.Write("a["+i+","+r+"]=");
a[i, j] = Convert.ToInt32(Console.ReadLine());
r++;
}
r = 0;
}
for (int i = 0; i < m; i++)
{
for (int j = 0; j < n; j++)
{
Console.Write(a[i,j]+" ");
}
Console.WriteLine();
}
}
}
}
using System;
namespace Amaliyot
{
class Program
{
static void Main(string[] args)
{
int m;
Console.Write("m=");
m = Convert.ToInt32(Console.ReadLine());
int[,] a = new int[m,m];
for (int i = 0; i < m; i++)
{
for (int j = 0; j < m; j++)
{
Console.Write("a[" + i + "," + j + "]=");
a[i, j] = Convert.ToInt32(Console.ReadLine());
}
}
int[,] a1 = new int[m, m];
int s1 = m - 1;
int s2 = m - 1;
for (int i = 0; i < m; i++)
{
if (i < m / 2)
{
for (int j = s1; j < m; j++)
{
a[i, j] = 0;
}
s1 = s1 - 1;
}
else
{
for (int j = s1; j < m; j++)
{
a[i, j] = 0;
}
s1 = s1 + 1;
}
}
for (int i = 0; i < m; i++)
{
for (int j = 0; j < m; j++)
{
Console.Write(a[i,j]+" ");
}
Console.WriteLine();
}
}
}
}