Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Text;
- using System.Linq;
- namespace ConsoleApp1
- {
- class Student {
- public string name;
- public uint score;
- }
- class ClassRoom {
- public List<Student> students = new List<Student>();
- //定義索引
- public List<Student> this[uint score] {
- get {
- return students.Where(o => o.score == score).ToList();
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement