for (int i=0;i<8;i++)
{
if (Convert.ToInt16(info[i,1])>maxScore)
{
maxName=info[i,0].toString();
maxScore=Convert.ToInt16(info[i,1]);
}
}
Console.Write("分数最高的是{0},分数是{1}",maxName, maxScore);
{
if (Convert.ToInt16(info[i,1])>maxScore)
{
maxName=info[i,0].toString();
maxScore=Convert.ToInt16(info[i,1]);
}
}
Console.Write("分数最高的是{0},分数是{1}",maxName, maxScore);
string[] name = { "吴松", "钱东宇", "伏晨", "陈陆", "周蕊", "林日鹏", "何昆", "关欣" };
int[] score = { 89, 90, 98, 56, 60, 91, 93, 85 };
int maxScore = score[0];
int nameId = 0;
for(int i=0; i<score.Length; i++)
{
if (maxScore < score[i])
{ maxScore = score[i];
nameId=i;
}
}
int[] score = { 89, 90, 98, 56, 60, 91, 93, 85 };
int maxScore = score[0];
int nameId = 0;
for(int i=0; i<score.Length; i++)
{
if (maxScore < score[i])
{ maxScore = score[i];
nameId=i;
}
}
最新回答 / tkom233
Console.Write("我的工资奖金总额是{0}元",salary+prize);这段代码的意思是打印“我的工资奖金是{0}元”这句话,{0}的作用是引用“ ”之后的第一个值(用逗号区分),因为计算机语言是从0开始数,所以是{0},在这段代码中,{0}引用的值即是 salary+prize的值举个例子:Console.Write("我的工资是{0},奖金是{1}",salary, prize);在这段代码中,{0}对应的就是“”之后的第一个值,也就是salary的值,{1}对应的是“”之后的第二个值...
2016-05-21
int[] num = new int[] { 3,34,42,2,11,19,30,55,20};
for(int i=0;i<num.Length;i++)
{
if(num[i]%2==0)
{
Console.WriteLine(num[i]+",");
}
}
Console.ReadLine();
for(int i=0;i<num.Length;i++)
{
if(num[i]%2==0)
{
Console.WriteLine(num[i]+",");
}
}
Console.ReadLine();
string []names=new string[5];
names[0]="关羽";
names[1]="张飞";
names[2]="赵云";
names[3]="马超";
names[4]="黄忠";
for(int i=0;i<names.Length;i++){
Console.WriteLine(names[i]+"");
}
Console.ReadLine();
names[0]="关羽";
names[1]="张飞";
names[2]="赵云";
names[3]="马超";
names[4]="黄忠";
for(int i=0;i<names.Length;i++){
Console.WriteLine(names[i]+"");
}
Console.ReadLine();
string[] job =new string [4];
job[0]="经理";
job[1]="项目总管";
job[2]="技术总监";
job[3]="财务主管";
for (int i = 0; i <job.Length;i++)
{
Console.WriteLine(job[i]);//打印职位
}
Console.ReadLine();
job[0]="经理";
job[1]="项目总管";
job[2]="技术总监";
job[3]="财务主管";
for (int i = 0; i <job.Length;i++)
{
Console.WriteLine(job[i]);//打印职位
}
Console.ReadLine();