分析下面的C#代碼,該程式的運行結果是( )。 class Check{ static void Main(string[] args){ int x=1; String[] names={"A","B","C"}; names[--x]+=","; for(int i=0;i<names.Length;i++){ Console.Write(names[i]); } } }
(結果判斷、單選題、2.00分)
a
列印輸出A,BC
b
列印輸出AB,C
c
列印輸出ABC,
d
列印輸出ABC
、以下C#代碼實作的功能是( )。 static void Main(String[] args){ int[] arr = {34,63,2,12,41}; int x=0; for(int i=0;i<arr.Length;i++) x=x<arr[i]?arr[i]:x; Console.Write(x); }
(概念理解、單選題、2.00分)
a
獲取陣列的最大索引值
b
判斷陣列中是否存在重復元素
c
獲取陣列中元素的個數
d
獲取陣列中的最大元素
、以下C#程式輸出的結果為?<br /> static void Main(string[] args)<br /> {<br /> int score=80;<br /> if(score>90) <br /> Console.WriteLine("好");<br /> else if(score>80)<br /> Console.WriteLine("良好");<br /> else<br /> Console.WriteLine("一般");<br /> }<br />
(結果判斷、單選題、2.00分)
a
好
b
良好
c
一般
d
80
現有如下一段c#代碼,該代碼的運行結果是( ) public static void Main() { for(int i=1;i<=3;i++) { switch(i) { case 1: Console.Write(i.ToString()); break; default: Console.Write((i*2).ToString()); break; } } }
(概念理解、單選題、2.00分)
a:146
b:有編譯錯誤
c:246
d:123
轉載請註明出處,本文鏈接:https://www.uj5u.com/houduan/151764.html
標籤:非技術區
上一篇:洗掉字串中指定字符
下一篇:C語言的穢土轉生—指標
