您的位置:首页 > 其它

一个班级的学生成绩存在长度为10的数组中,计算不及格的学生数目

2017-12-28 09:51 405 查看
public class StudentPerformanceCalculation {
public static void main(String[] args) {
int b=0;
float score[] = { 83.0f, 83.0f, 83.5f, 96.0f, 57.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 );
}

}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐