整数排序
Time Limit:1000MS Memory Limit:65536K
Total Submit:276 Accepted:164
Description
给10个整数a(i)(0=<ai<=1000)
输出排序好之后的序列
Input
输入为一行,包含10个无规则的整数,用空格分隔
Output
按照从小大排序后的十个整数
Sample Input
9 8 6 2 1 5 0 3 4 7
Sample Output
0 1 2 3 4 5 6 7 8 9
Source
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace AK1128 {
class Program {
static void Main(string[] args) {
string[] s = Console.ReadLine().Split();
int[] a = new int[10];
for (int i = 0; i < 10; i++)
a[i] = int.Parse(s[i]);
Array.Sort(a);
foreach (int i in a)
Console.Write(i + " ");
Console.WriteLine();
//Console.ReadLine();
}
}
}
6137

被折叠的 条评论
为什么被折叠?



