package pinduoduo;
import java.util.Scanner;
public class continue_ {
public static void main(String[] args) {
/*循环录入Java课的学生成绩,
* 统计分数大于等于80分的学生比例
* */
Scanner input = new Scanner(System.in);
System.out.println("请输人数");
int total = input.nextInt();
double score=0;//定义成绩变量
int num= 0; //合格人数变量
for (int i = 1; i <= total; i++) {
System.out.print("请输第 "+i+"成绩");
score = input.nextDouble();
/*if(score>=80){
num++;
}*/ //也可以不使用conrinue
if(score<80){
continue;
}
num++;
}
System.out.println(num);
double bili = (double)num / total * 100;
System.out.println(bili+"%");
}
}
05-23
1156
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)