[C#]上课笔5月27日,Linq的使用方法
时间:2021-06-02 12:28:38
收藏:0
阅读:0
Linq的操作对象都是集合。
public partial class Form1 : Form { public Form1() { InitializeComponent(); int[] scores = { 90, 71, 82, 93, 75, 82 }; IEnumerable<int> scoreQuery = from score in scores where score > 80 orderby score descending select score; foreach (int x in scoreQuery) { lblShow.Text += x + "分" + "\n"; } } }
评论(0)