using System.Threading; namespace ConsoleApplication1 { class Program { static void Main(string[] args) { Console.Write("输入个数:"); int A = int.Parse(Console.ReadLine()); int[] x = new int[A]; int a = x.Length; Console.Write("输入个数:"); int B = int.Parse(Console.ReadLine()); int[] y = new int[B]; int b = y.Length; Console.Write("输入个数:"); int C = int.Parse(Console.ReadLine()); int[] z = new int[C]; int c = z.Length; int[, ,] sza = new int[A, B, C]; for (int i = 0; i < a; i++) { for (int j = 0; j < b; j++) { for (int k = 0; k < c; k++) { Thread.Sleep(500); Random r = new Random(); sza[i,j,k] = r.Next(1, 99); Console.Write(sza[i, j, k] + " "); } } } Console.WriteLine(); foreach (int m in sza) //遍历数组或其他集合 { Console.Write(" " + m); } int l = sza.Length; Console.WriteLine(" 数组总字符数 " + l); Console.ReadLine(); } } }