Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace console
- {
- class Program
- {
- static void Main(string[] args)
- {
- Random rd = new Random();
- int k, s1, s2, k1, k2;
- Console.Write("Размер массивов:");
- k = Convert.ToInt32(Console.ReadLine());
- double[] h = new double[k];
- double[] m = new double[k];
- Console.Write("Мин.Рост:");
- s1 = Convert.ToInt32(Console.ReadLine());
- Console.Write("Мaк.Рост:");
- s2 = Convert.ToInt32(Console.ReadLine());
- Console.Write("Мин.Вес:");
- k1 = Convert.ToInt32(Console.ReadLine());
- Console.Write("Мaк.Вес:");
- k2 = Convert.ToInt32(Console.ReadLine());
- for (int i = 0; i < h.Length; i++)
- h[i] = rd.Next(s1, s2);
- for (int i = 0; i < m.Length; i++)
- m[i] = rd.Next(k1, k2);
- Console.Write("Массив Рост:");
- foreach (int a in h) Console.Write("{0} ", a);
- Console.Write("\nМассив Вес:");
- foreach (int a in m) Console.Write("{0} ", a);
- Array.Sort(h, m);
- Console.WriteLine();
- foreach (int a in h) Console.Write("{0} ", a);
- Console.WriteLine();
- foreach (int a in m) Console.Write("{0} ", a);
- Console.ReadLine();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment