int sum = 0, avg;
for (int i = 0; i < score.Length; i++)
{
sum += score[i];
}
avg = sum / score.Length;
Console.Write("平均分是{0},", avg);
int max = avg;
Console.WriteLine("高于平均分的有:");
for (int i = 0; i < score.Length; i++)
{
sum += score[i];
}
avg = sum / score.Length;
Console.Write("平均分是{0},", avg);
int max = avg;
Console.WriteLine("高于平均分的有:");
Console.WriteLine(x+" ") 谁解释一下 。看不懂x+""
打印变量X后再打印一个空格
打印变量X后再打印一个空格
2016-06-03
/*如下写法有报错:the name 'age' does not exit in the current context.
int[] age = new int[4];
age[0] = 18;
age[1] = 19;
age[2] = 20;
age[3] = 21;
Console.WriteLine("四位同学的年龄分别是:{0}、{1}、{2}、{3}", age[0], age[1], age[2], age[3]);
int[] age = new int[4];
age[0] = 18;
age[1] = 19;
age[2] = 20;
age[3] = 21;
Console.WriteLine("四位同学的年龄分别是:{0}、{1}、{2}、{3}", age[0], age[1], age[2], age[3]);
2016-06-02
最新回答 / 悟於此城
Console.Write("我的工资奖金总额是{0}元",salary+prize); Console.WriteLine("我的税后收入是{0}元",salary+prize-tax); //问题出在Console.WriteLine和 Console.Write上!不知道怎么解释。
2016-06-02
string[] name=new string[] {"吴松","钱东宇","伏晨","陈陆","周蕊","林日鹏","何昆","关欣"};
int[] score=new int[] {89,90,98,56,60,91,93,85};
int x=0;
int max=0;
for(int i=0;i<score.Length;i++) {
if(max<score[i]){
max=score[i];
x=i; } }
Console.Write("分数最高的是{0},分数是{1}",name[x],score[x])}}
int[] score=new int[] {89,90,98,56,60,91,93,85};
int x=0;
int max=0;
for(int i=0;i<score.Length;i++) {
if(max<score[i]){
max=score[i];
x=i; } }
Console.Write("分数最高的是{0},分数是{1}",name[x],score[x])}}
static void Main(string[] args)
{
string[] job = { "经理", "项目主管", "技术总监", "财务主管" };
for (int x = 0; x < job.Length; x++)
{
Console.WriteLine(job[x]);
}
}
{
string[] job = { "经理", "项目主管", "技术总监", "财务主管" };
for (int x = 0; x < job.Length; x++)
{
Console.WriteLine(job[x]);
}
}
2016-06-01