private void button1_Click(object sender, EventArgs e)
{
int[] numbers = new int[] { ,,,,,,};
var result0 = from num in numbers
where (num % == )
select num;
foreach (int n in result0)
{
listBox1.Items.Add(n);
}
} private void button2_Click(object sender, EventArgs e)
{
listBox1.Items.Clear();
int[] numbers = new int[] { ,,,,,,};
var result1 = from num in numbers
where num >
orderby num descending
select num;
foreach (int n in result1)
{
listBox1.Items.Add(n);
}
} private void button3_Click(object sender, EventArgs e)
{
listBox1.Items.Clear();
int[] numbers = new int[] { , , , , , , };
var result2 = from num in numbers
where num >
orderby num ascending
select string.Format("当前值为{0}",num) ;
foreach (string n in result2)
{
listBox1.Items.Add(n);
}
} private void button4_Click(object sender, EventArgs e)
{
listBox1.Items.Clear();
int[] numbers = new int[] { , , , , , , };
int result3 = (from num in numbers
where num >
select num).Count();
button4.Text += "--" + result3.ToString();
}