//一个班级的学生成绩存在长度为10的数组中,计算不及格的学生数目
public class Xueshengcjshuzu {
public static void main(String[] args) {
int b=0;
float score[] = { 83.0f, 83.0f, 83.5f, 96.0f, 97.0f, 98.5f,52.5f,43.5f,60.5f,78.0f};
for (int i = 0; i < 10; i++) {
if ( score[i]< 60) {
b++;
}
}
System.out.println("不及格的学生人数:" +b );
}
public class Xueshengcjshuzu {
public static void main(String[] args) {
int b=0;
float score[] = { 83.0f, 83.0f, 83.5f, 96.0f, 97.0f, 98.5f,52.5f,43.5f,60.5f,78.0f};
for (int i = 0; i < 10; i++) {
if ( score[i]< 60) {
b++;
}
}
System.out.println("不及格的学生人数:" +b );
}
}