1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
| using System; namespace Prosose { public class Fibonacci { static void Main(string[] args) { int[] array = new int[] {3, 5, 1, 8, 6, 4, 33, 13, 26, 13}; int temp;
for(int a = 0; a < array.Length - 1; a ++) { for(int i = 0; i < array.Length -1; i ++) { if (array[i] > array[i + 1]) { temp = array[i]; array[i] = array[i + 1]; array[i + 1] = temp; } } } foreach (int Recursive in array) { Console.Write(Recursive + ","); } } } }
|