這個答案有問題啊,正確答案應該是
double x, y;
x = y = 2;//从右向左赋值,x、y的值都是2
x /= 0.5;
y -= 2;
Console.WriteLine(x);
Console.WriteLine(y);
Console.WriteLine(x - y);
}
}
}
double x, y;
x = y = 2;//从右向左赋值,x、y的值都是2
x /= 0.5;
y -= 2;
Console.WriteLine(x);
Console.WriteLine(y);
Console.WriteLine(x - y);
}
}
}
2018-10-22
代码改为console.writeline((int)x>=y);或者console.writeline((double)x>y);两种方式都是可以的
2018-10-19
for (int y = 1; y <= 7; y++)
{
for (int x = 1; x <= 7; x++)
{
Console.Write(x);
if(x>=y)
break;
}
Console.WriteLine();//换行
}
{
for (int x = 1; x <= 7; x++)
{
Console.Write(x);
if(x>=y)
break;
}
Console.WriteLine();//换行
}
2018-10-14
int//(int or double) 变量 = (int)d
会将变量转换为无小数点数,直接去掉小数点后的数,无需四舍五入。
会将变量转换为无小数点数,直接去掉小数点后的数,无需四舍五入。
2018-10-10
static void Main(string[] args)
{
int year = 2015;//年份
string text;
text=year%4==0?"闰年":"平年";//请填写代码
Console.WriteLine("今年是{0}",text);
}
{
int year = 2015;//年份
string text;
text=year%4==0?"闰年":"平年";//请填写代码
Console.WriteLine("今年是{0}",text);
}
2018-10-09