int max=0;int sum=0;string str="";string[,]stu =new string[8, 2]{ { "景珍","90" },...};for(int j = 0;j<8;j++){sum+=Convert.ToInt32(stu[j, 1]);}int avg =sum/8;for(int i=0; i<8;i++){if(Convert.ToInt32(stu[i,1])>avg){str+=stu[i,0]+""; }}Console.WriteLine("平均分是{0},{1}",avg,",高于平均分的有:");Console.Write(str);
Console.WriteLine("{0}{1}{2}",ch[1,1],ch[1,2],ch[2,0]);
2016-01-05
string[] job = { "经理", "项目主管", "技术总监", "财务主管" };
for (int i = 0; i < job.Length; i++)
{
Console.Write(job[i]);
}
注意 不要换行打印
for (int i = 0; i < job.Length; i++)
{
Console.Write(job[i]);
}
注意 不要换行打印
2016-01-05
int year = 2015;//年份
string text;
if(year%4==0)
{
text="闰年";
}
else
{
text="平年";
}
Console.WriteLine("今年是{0}",text);
}
string text;
if(year%4==0)
{
text="闰年";
}
else
{
text="平年";
}
Console.WriteLine("今年是{0}",text);
}
2016-01-05