判断
if switch
输入三个整数6、 5、9,请把它们由大到小输出。
int a = 6, b = 5, c = 9, t = 0;
if (a < b)
{
t = a;
a = b;
b = t;
}
if (a < c)
{
t = a;
a = c;
c = t;
}
if (b < c)
{
t = b;
b = c;
c = t;
}
Console.WriteLine(a + "\t" + b + "\t" + c);
11+22+33+44+55=165判断是否为真?
int a = 11 + 22 + 33 + 44 + 55;
int b = 165;
bool t = a == b ? true : false;
if (t)
{
Console.WriteLine("真");
}
else
{
Console.WriteLine("假");
}
循环
for while:先判断在执行 do while:先执行一次在判断
<