标签:io ar for cti sp on c line ad
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace maopao { class Program { static void Main(string[] args) { int[] nums = new int[10]; Console.Write("输入十个整数:\n"); for (int i = 0; i < 10; i++) { nums[i] = int.Parse(Console.ReadLine()); } int temp = 0; for (int j = 0; j < 9; j++) { for (int i = 0; i < 9 - j; i++) if (nums[i] > nums[i + 1]) { temp = nums[i]; nums[i] = nums[i + 1]; nums[i + 1] = temp; } } Console.WriteLine("排序的结果为:\n"); for (int i = 0; i < 10; i++) { Console.Write("{0}{1}", nums[i], ' '); } Console.ReadLine(); } } }
标签:io ar for cti sp on c line ad
原文地址:http://blog.csdn.net/zjx211314/article/details/39158041