最新回答 / darkstars
? ? ? ? ? ? string[] name = new string[] { "景珍", "林惠洋","程蓉", "洪南昌", "龍玉明", "單江開", "田武開", "王三明" };? ? ? ? ? ? int[] sum = new int[] { 90, 65, 88, 70, 46, 81, 100, 68 };? ? ? ? ? ? Console.Write("平均分是76高于平均分的有:");? ? ? ? ? ? for (int i = 0; i < sum.Lengt...
2020-11-16
最新回答 / darkstars
? ? ? ? ? ? string[] name = new string[] { "景珍", "林惠洋","成蓉", "洪南昌", "龍玉明", "單江開", "田武山", "王三明" };? ? ? ? ? ? int[] sum = new int[] { 90, 65, 88, 70, 46, 81, 100, 68 };? ? ? ? ? ? Console.Write("平均分是76,高于平均分的有:");? ? ? ? ? ? for (int i = 0; i < sum.Leng...
2020-11-04
//請完善代碼,判斷數組中有沒有7的整倍數
bool hasSeven = false;
foreach (int temp in num) {
hasSeven = temp % 7 == 0 ? true : false ;
if(hasSeven)
break;
}
Console.Write(hasSeven ? "有7的整倍數" : "沒有7的整倍數");
bool hasSeven = false;
foreach (int temp in num) {
hasSeven = temp % 7 == 0 ? true : false ;
if(hasSeven)
break;
}
Console.Write(hasSeven ? "有7的整倍數" : "沒有7的整倍數");
直接改成Console.WriteLine(true);也行...系統只檢查最后輸出內容,不管中間過程合理不合理
2020-11-02
明白了。
1. bool a = ++x * x > 3;
bool b = a;
2. bool a = ++x * x > 3;
bool b = ++x * x > 3;
1. bool a = ++x * x > 3;
bool b = a;
2. bool a = ++x * x > 3;
bool b = ++x * x > 3;
2020-10-30
已采納回答 / KulooM
第二張圖score[i]=s的意思是把 s 的值賦給 score[i],所以無論怎么循環,s 的值是沒有變化的,一直是你開始定義的int s = score[0],也就是第一個數,89
2020-10-26