[C#] LINQ 여러개의 데이타원본에 Query 날리기~
class Class
{
public string Name;
public int[] Score;
}
class Program
{
//delegate int LamdaTest(int[] arg);
////delegate int TestWhat(int[] arg);
//delegate int Result(int[] arg);
//delegate int Sum(int[] arg);
//delegate int Calculator2(int a, int b);
//delegate string Concatenate(string[] args);
static void Main(string[] args)
{
Class[] arrThird_4 =
{
new Class() {Name = "해준", Score = new int[] {44,22,34,23,42}},
new Class() {Name = "민지", Score = new int[] {45,2,42,33,44}},
new Class() {Name = "성민", Score = new int[] {0,0,0,0,0,0}},
new Class() {Name = "지혜", Score = new int[] {50,55,55,34,55}}
};
var classes = from c in arrThird_4
from s in c.Score
where s < 60
orderby s
select new { c.Name, Lowest = s };
foreach (var c in classes)
Console.WriteLine("낙제 : {0} ({1})", c.Name, c.Lowest);
댓글
댓글 쓰기