int[] age = new int[4];//声明并初始化长度为4的整形数组
//为数组元素赋值
age[0] = 18;
age[1] = 20;
age[2] = 23;
age[3] = 17;
Console.WriteLine("四名同学的年龄是:{0}、{1}、{2}、{3}",
age[0],age[1],age[2],age[3]);
//为数组元素赋值
age[0] = 18;
age[1] = 20;
age[2] = 23;
age[3] = 17;
Console.WriteLine("四名同学的年龄是:{0}、{1}、{2}、{3}",
age[0],age[1],age[2],age[3]);
2018-07-20
然而我就想这样写,结果告诉我输出不正确(笑)
double salary = 6000.00;//基本工资
double prize = 3200.00;//奖金
double tax = 4500.00;//交税
double s=0.00;
s=salary+prize;
Console.WriteLine("我的工资奖金总额是{0}元",s);
Console.WriteLine("我的税后收入是{0}元",s-tax);
看来这不是真正的网页编译器吧。
不是吧。
double salary = 6000.00;//基本工资
double prize = 3200.00;//奖金
double tax = 4500.00;//交税
double s=0.00;
s=salary+prize;
Console.WriteLine("我的工资奖金总额是{0}元",s);
Console.WriteLine("我的税后收入是{0}元",s-tax);
看来这不是真正的网页编译器吧。
不是吧。
2018-07-17
int year = 2018;
string text = (year % 4 == 0 && year % 100 != 0)||year % 400 == 0 ? "闰年":"平年";
Console.WriteLine("今年是{0}",text);
string text = (year % 4 == 0 && year % 100 != 0)||year % 400 == 0 ? "闰年":"平年";
Console.WriteLine("今年是{0}",text);
2018-07-09