【简答题】写出下列程序的运行结果 static void Main(string[] args) { int[] myint = {1,28,5,7,678,3,8,34}; Array.Sort(myint); foreach (int a in myint) { Console.Write(a+" ");// 引号中为一个空格 } Console.ReadKey(); } 输出结果是:
【简答题】写出下列程序的运行结果 static void Main(string[] args) { int[] num1 = {1,2,3,4,5,6,7,8,9 }; int[] jgnum = new int[10]; Array.Copy(num1,2,jgnum,3,4); foreach (int outnum in jgnum) { Console.Write(outnum + " ");//...
【简答题】写出下列程序的运行结果 static void Main(string[] args) { string[] Name = {" 张三 "," 李四 "," 王五 "," 赵六 " }; Name[3] = " 刘七 "; foreach (string mystr in Name) { Console.WriteLine(mystr); } Console.ReadLine(); } 输出结果是...
【简答题】写出下列程序的运行结果 static void Main(string[] args) { int var1 = 10; bool mybool = false; mybool = var1 = 2; Console.WriteLine(mybool); Console.ReadKey(); } 输出结果是:
【简答题】写出下列程序的运行结果 static void Main(string[] args) { int a = 10, b = 7; a += b; Console.WriteLine("a+=b 的值是 {0}",a); Console.ReadKey(); } 输出结果是:
【简答题】写出下列程序的运行结果 static void Main(string[] args) { int num = 1; while (num <= 5) { Console.Write (num+" ");// 引号中为一个空格 num++; } Console.ReadKey(); } 输出结果是:
【简答题】写出下列程序的运行结果 static void Main(string[] args) { string a = "www.yzgzx.com"; int b = a.LastIndexOf('z'); Console.WriteLine(b); Console.ReadKey(); } 输出结果是: