using System; using System.Collections.Generic; using System.Text; namespace Application { class Program { static void Main(string[] args) { int[] a = new int[] { 5, 12, 13, 2, 1, 9, 15, 19, 6 }; int oneMinValue = a[0]; int twoMinValue = a[0]; for (int i = 0; i < a.Length; i++) { if (twoMinValue > a[i]) { twoMinValue = a[i]; } if (twoMinValue < oneMinValue) { int tmp = twoMinValue; twoMinValue = oneMinValue; oneMinValue = tmp; } } Console.WriteLine(oneMinValue); Console.WriteLine(twoMinValue); } } }