public class Student
{
public Student(string name, int score)
{
Name = name;
Score = score;
}
public string Name { get; set; }
public int Score { get; set; }
}
}
{
public Student(string name, int score)
{
Name = name;
Score = score;
}
public string Name { get; set; }
public int Score { get; set; }
}
}
Console.Write("分数最高的是");
foreach(var student in hightestScoreStudents)
{
Console.WriteLine("{0},分数是{1}", student.Name, student.Score);
}
}
}
foreach(var student in hightestScoreStudents)
{
Console.WriteLine("{0},分数是{1}", student.Name, student.Score);
}
}
}
public static void TheHightestScoreStudent(List<Student> students)
{
var hightestScoreStudents = from student in students
where student.Score ==students.Max(x => x.Score)
select student;
{
var hightestScoreStudents = from student in students
where student.Score ==students.Max(x => x.Score)
select student;
new Student("陈陆",56),
new Student("周蕊",60),
new Student("林日鹏",91),
new Student("何昆",93),
new Student("关欣",85)
};
TheHightestScoreStudent(students);
}
new Student("周蕊",60),
new Student("林日鹏",91),
new Student("何昆",93),
new Student("关欣",85)
};
TheHightestScoreStudent(students);
}
namespace projGetMaxScore
{
class Program
{
static void Main(string[] args)
{
List<Student> students = new List<Student>{
new Student("吴松",89),
new Student("钱冬宇",90),
new Student("伏晨",98),
{
class Program
{
static void Main(string[] args)
{
List<Student> students = new List<Student>{
new Student("吴松",89),
new Student("钱冬宇",90),
new Student("伏晨",98),
using System;
using System.Collections.Generic;
using System.Text;
using System.Linq;
using System.Collections.Generic;
using System.Text;
using System.Linq;
最新回答 / qq_慕的地6528064
这样 for (int i = 1; i < 100; i++) { Console.Write(i+"\t"); if (i%5==0) { Console.WriteLine() ; } }
2018-04-18
最新回答 / 粗实而夜雨
我复制了你的代码,重新跑了一遍发现的错误就是你的代码中有几个分号写成了中文的格式,你改下试试using System;using System.Collections.Generic;using System.Text;namespace Test{ class Program { static void Main(string[] args) { string boy = "秀丽";//男孩名字 ...
2018-04-16
for (int x = 1; x <= 7; x++)
{
Console.Write(x);
if(x==y)
break;
{
Console.Write(x);
if(x==y)
break;
2018-04-16