已采纳回答 / 什么都不懂得小透明
Console.WriteLine("你好,{0]!",name);应该为 Console.WriteLine("你好,{0}!",name)
2018-07-21
double salary = 6000.00;//基本工资
double prize = 3200.00;//奖金
double tax = 4500.00;//交税
Console.Write("我的工资奖金总额是{0}元",salary + prize);
Console.Write("我的税后收入是{0}元",salary + prize - tax);
double prize = 3200.00;//奖金
double tax = 4500.00;//交税
Console.Write("我的工资奖金总额是{0}元",salary + prize);
Console.Write("我的税后收入是{0}元",salary + prize - tax);
2018-07-20
string[] name=new string[] { "景珍", "林惠洋", "成蓉", "洪南昌", "龙玉民", "单江开", "田武山", "王三明" };
int[] score=new int[] {90,65,88,70,46,81,100,68 };
double avg =score.Average();
Console.WriteLine("平均分是"+avg+","+"高于平均分的有:");
for (int a = 0; a < score.Length; a++)
{if (score[a] >avg)
{Console.Write(name[a]+" ");}}
int[] score=new int[] {90,65,88,70,46,81,100,68 };
double avg =score.Average();
Console.WriteLine("平均分是"+avg+","+"高于平均分的有:");
for (int a = 0; a < score.Length; a++)
{if (score[a] >avg)
{Console.Write(name[a]+" ");}}
string[] name={"吴松","钱东宇","伏晨","陈陆","周茹","林日鹏","何昆","关欣"};
int[]score={89,90,98,56,60,91,93,85};
int Max=0;
int index=0;
for(int i=0;i<score.Length;i++)
{
if(score[i]>Max)
{
Max=score[i];
index=i;
}
}
Console.WriteLine ("分数最高的是" + name[index] + ",分数是" + Max);
int[]score={89,90,98,56,60,91,93,85};
int Max=0;
int index=0;
for(int i=0;i<score.Length;i++)
{
if(score[i]>Max)
{
Max=score[i];
index=i;
}
}
Console.WriteLine ("分数最高的是" + name[index] + ",分数是" + Max);
Console.WriteLine("{0}{1}{2}",ch[1,1],ch[1,2],ch[2,0]);
2018-07-20
if (score[i] < 60)//如果有不及格的
{
//记录有不及格的
hasNopass=true;
break;
}
{
//记录有不及格的
hasNopass=true;
break;
}
2018-07-20
int[] score = new int[] {89,39,100,51,94,65,70 };//分数
Console.Write("不及格的有:");
for (int i = 0; i < score.Length ; i++)
{
if( score[i]<60 )//筛选条件
Console.Write(score[i]+",");
}
Console.Write("不及格的有:");
for (int i = 0; i < score.Length ; i++)
{
if( score[i]<60 )//筛选条件
Console.Write(score[i]+",");
}
2018-07-20
string[] job = new string[4];
job[0]="经理";
job[1]="项目主管";
job[2]="技术总监";
job[3]="财务主管";
for (int i = 0; i < 4 ; i++)
{
Console.Write(job[i]);//打印职位
}
job[0]="经理";
job[1]="项目主管";
job[2]="技术总监";
job[3]="财务主管";
for (int i = 0; i < 4 ; i++)
{
Console.Write(job[i]);//打印职位
}
2018-07-20
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