大佬们, 为什么这样写不行?应该如何写?
static void Main(string[] args)
{
Console.WriteLine(true || false);//输出True
Console.WriteLine(true && false);//输出False
Console.WriteLine(!false);//输出True
}
}
static void Main(string[] args)
{
Console.WriteLine(true || false);//输出True
Console.WriteLine(true && false);//输出False
Console.WriteLine(!false);//输出True
}
}
2017-08-01
最赞回答 / 慕标7081707
double salary = 6000.00;//基本工资 double prize = 3200.00;//奖金 double tax = 4500.00;//交税 Console.Write("我的工资奖金总额是{0}元",salary+prize); Console.WriteLine("我的税后收入是{0}元",salary+prize-tax);
2017-08-01
最新回答 / qq__7851
console.writeline((int)x=y); 等号的左边当然的是变量 赋值当然是给变量赋值 还有你的X是BOOL值还是数值,你括号里的式子是数据类型中的强制转化 要程序成立 把赋值改成比较
2017-07-31
for (int x=1;x<=12;x++)//请填写代码
{
Console.Write(x+" ");
}
{
Console.Write(x+" ");
}
2017-07-31
for(int i = 0; i < scores.Length;i++)
{
if(scores[i] > avg)
{
Console.Write(name[i]+" ");
}
}
逗号 和 引号都要用 中文 全角的
{
if(scores[i] > avg)
{
Console.Write(name[i]+" ");
}
}
逗号 和 引号都要用 中文 全角的
avg = sum / scores.Length;
Console.WriteLine("平均分是"+avg+",高于平均分的有:");
Console.WriteLine("平均分是"+avg+",高于平均分的有:");
int sum = 0; // 总和
int avg; // 平均分
foreach(int x in scores)
{
sum += x;
}
int avg; // 平均分
foreach(int x in scores)
{
sum += x;
}