/*-------------------------------------------------------
【程序填空】
---------------------------------------------------------
本题的功能是统计成绩不及格的人数,分数有56,90,89,23,45,61,60,59。
-------------------------------------------------------*/
【程序填空】
---------------------------------------------------------
本题的功能是统计成绩不及格的人数,分数有56,90,89,23,45,61,60,59。
-------------------------------------------------------*/
public class Prog1{
public static void main(String[] args) {
int []score={56,90,89,23,45,61,60,59};
/***********SPACE***********/
【?】;
int i=0;
/***********SPACE***********/
while(【?】){
/***********SPACE***********/
if(【?】)
sum++;
i++;
}
System.out.println("<60:"+sum);
}
}
答案:
public class Twotk4{
public static void main(String[] args) {
int []score={56,90,89,23,45,61,60,59};
/***********SPACE***********/
int sum=0;
int i=0;
/***********SPACE***********/
while(i<score.length){
/***********SPACE***********/
if(score[i]<60)
sum++;
i++;
}
System.out.println("<60:"+sum);
}
}
运行结果: