如果把第一个{0}改成{1},第二个{1}改成{0},其他不变,输出就会把性别放置前面,姓名放在后面,类似于把后面的变量看成数组,{}填入数字作为下标
2019-03-17
for (int x = 1; x <= 7; x++)
{
for (int y = 7; y >= 1; y--)
{
if (x + y == 8 || x == y)
Console.Write("o");
else
{
Console.Write(".");
}
}
Console.WriteLine();
}
{
for (int y = 7; y >= 1; y--)
{
if (x + y == 8 || x == y)
Console.Write("o");
else
{
Console.Write(".");
}
}
Console.WriteLine();
}
for (int y = 1; y <= 7; y++)
{
for (int x = 1; x <= 7; x++)
{
if(x > y)
continue;
Console.Write(x);
}
Console.WriteLine();//换行
}
{
for (int x = 1; x <= 7; x++)
{
if(x > y)
continue;
Console.Write(x);
}
Console.WriteLine();//换行
}
2019-03-08
double salary = 6000.00;//基本工资
double prize = 3200.00;//奖金
double tax = 4500.00;//交税
Console.Write("我的工资奖金总额是{0}元",salary + prize);
Console.WriteLine("我的税后收入是{0}元",salary +prize- tax);
double prize = 3200.00;//奖金
double tax = 4500.00;//交税
Console.Write("我的工资奖金总额是{0}元",salary + prize);
Console.WriteLine("我的税后收入是{0}元",salary +prize- tax);
2019-03-05
static void Main(string[] args)
{
for (int y = 1; y <= 7; y++)
{
for (int x = 1; x <= 7; x++)
{
Console.Write(x);
}
Console.WriteLine();//换行
}
}
{
for (int y = 1; y <= 7; y++)
{
for (int x = 1; x <= 7; x++)
{
Console.Write(x);
}
Console.WriteLine();//换行
}
}
2019-02-28