最新回答 / 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
最新回答 / 辰风依旧
// 创建姓名数组,存储8位同学的姓名 string[] names = new string[]{"景珍","林惠洋","成蓉","洪南昌","龙玉民","单江开","田武山","王三明"}; // 创建分数数组,存储9位同学的分数 int[] scores = new int[]{90,65,88,70,46,81,100,68}; // 循环数组,累加总分 int su...
2020-10-18
已采纳回答 / 低调彡
if(salary>=price) { Console.WriteLine("这月工资够买手机!"); } else { Console.WriteLine("这月工资不够买手机!"); }
2020-10-15
太粗心了,小错误不断:
1..数组声明完忘写“;”
2.for错写成foreach
3.i忘记声明int
4.for循环内应用“;”隔开而不是“,”
5.Console.Write首字母大写
6.忘记}对应
1..数组声明完忘写“;”
2.for错写成foreach
3.i忘记声明int
4.for循环内应用“;”隔开而不是“,”
5.Console.Write首字母大写
6.忘记}对应