int[] nums = { 12,13,14,15,16,17,18}; //初始化字符串 int length = Convert.ToInt32(nums.Length);//转化 //Console.WriteLine(length); length=7 string[] str = new string[length]; for (int i = 0; i < str.Length; i++) { str[i] = Convert.ToString(nums[i]); } //输出新数组 Console.Write("新数组是:"); for (int i = 0; i < str.Length; i++) { Console.Write(" "+str[i]); } Console.WriteLine();
时间: 2024-10-12 22:30:41