Using System; using System.Collections.Generic; using System.Linq; using System.Text.RegularExpressions;
namespace Dcoder { public class Program { public static void Main(string[] args) { Console.Write("Размер массива: "); int n = Convert.ToInt32(Console.ReadLine()); int[] arr = new int[n]; Random rand = new Random(); for (int i = 0; i < arr.Length; i++) arr[i] = rand.Next(1, 100); for (int i = 0; i < arr.Length; i++) if (arr[i] % 2 == 0) Console.WriteLine(arr[i]);
Console.WriteLine();
for (int i = 0; i < arr.Length; i++) if (arr[i] % 2 != 0) Console.WriteLine(arr[i]); Console.ReadLine(); } } }
using System.Collections.Generic;
using System.Linq;
using System.Text.RegularExpressions;
namespace Dcoder
{
public class Program
{
public static void Main(string[] args)
{
Console.Write("Размер массива: ");
int n = Convert.ToInt32(Console.ReadLine());
int[] arr = new int[n];
Random rand = new Random();
for (int i = 0; i < arr.Length; i++)
arr[i] = rand.Next(1, 100);
for (int i = 0; i < arr.Length; i++)
if (arr[i] % 2 == 0)
Console.WriteLine(arr[i]);
Console.WriteLine();
for (int i = 0; i < arr.Length; i++)
if (arr[i] % 2 != 0)
Console.WriteLine(arr[i]);
Console.ReadLine();
}
}
}