using System;
using System.Collections.Generic;
using System.Text;
namespace Test
{
class Program
{
static void Main(string[] args)
{
int[] score = new int[] {89,39,100,51,94,65,70 };//分数
Console.Write("不及格的有:");
for (int i = 0; i < 7; i++)
{
if(score[i] < 60 )//筛选条件
Console.Write(score[i]+",");
}
}
}
}
因为你int数组里,有7个分数啊,也可写成 i<score.Length