static void Main(string[] args)
{
int i = 24;
while (i++ < 29)
if(i != 27)
Console.WriteLine(i);
Console.ReadKey();
}
static void Main(string[] args)
{
for (int i = 25; i < 30; i++)
if (i != 27)
Console.WriteLine(i);
Console.ReadKey();
}
static void Main(string[] args)
{
ConsoleKey ck ;
do
{
ck = Console.ReadKey().Key;
if (ck == ConsoleKey.D1 || ck == ConsoleKey.NumPad1)
continue;
Console.WriteLine("\nOne more iteration");
} while (ck != ConsoleKey.D0 && ck != ConsoleKey.NumPad0);
}
static void Main(string[] args)
{
int[,] arr = new int[,]{{ 0, 34, -2 }, { 3, -4, 5 } };
int min = arr[0,0];
for(var i =0; i < arr.GetLength(0);i++)
for(var j = 0; j < arr.GetLength(1);j++)
min = Math.Min(min, arr[i,j]);
Console.WriteLine("Min = " + min);
Console.ReadKey();
}
static void Main(string[] args)
{
List<int> dArr = new List<int>();
var rnd = new Random();
int max= 0;
for (int i = 0; i < 7; i++){
dArr.Add(rnd.Next(666));
Console.Write(dArr[i] + " ");
if (i == 0)
max= dArr[i];
else
max= Math.Max(max, dArr[i]);
}
Console.WriteLine("\nMax = " + max);
Console.ReadKey();
}