标签:
static void Main(string[] args) { Console.WriteLine("请输入十个数,并以空格隔开:"); string string1 = Console.ReadLine(); string[] string2 = System.Text.RegularExpressions.Regex.Split(string1, @"[ ]+");//表示按空格分隔,正则[0-9]表示匹配0到9的任意字符,这里匹配的是空格 string[] result = new string[10]; for (int i = 0; i < 10; i++) { result[i] = (string2[10 - i - 1]); Console.Write(result[i] + " "); } Console.ReadKey(); }
标签:
原文地址:http://www.cnblogs.com/miaoying/p/5539092.html