using System; public class Test { struct Obj { public string value1; public int value2; } static void Main(string[] args) { string[] Products = new string[4] { "Meat", "Bread", "Milk", "Chocolate" }; int[] Prices = new int[4] { 25, 4, 10, 16 }; Obj[] objs = new Obj[4]; for (int i = 0; i < 4; i++) Console.WriteLine(Products[i] + "\n" + Prices[i] + "\n\n"); for (int i = 0; i < 4; i++) { objs[i] = new Obj(); objs[i].value1 = Products[i]; objs[i].value2 = Prices[i]; } Array.Sort(objs, new Comparison((a, b) => a.value2.CompareTo(b.value2))); for (int i = 0; i < 4; i++) { Products[i] = objs[i].value1; Prices[i] = objs[i].value2; } for (int i = 0; i < 4; i++) Console.WriteLine(Products[i] + " " + Prices[i]); } }