package pro_04_08;
import java.util.Scanner;
public class PassFail {
public static void main(String[] args) {
// TODO Auto-generated method stub
int grade;
int numStudents = 0;
int numPass = 0;
int numFail = 0;
Scanner scan = new Scanner(System.in);
System.out.println("첫 번째 점수(종료하려면 음수)를 입력하세요 : ");
grade = scan.nextInt();
while (grade >=0)
{
numStudents++;
if (grade > 60) numPass++;
else numFail++;
System.out.println("다음 점수(종료하려면 음수)를 입력하세요 : ");
grade = scan.nextInt();
}
System.out.println("학생들의 수 : " + numStudents);
System.out.println("통과한 학생수" + numPass);
System.out.println("실패한 학생수" + numFail);
}
}
Comments
Post a Comment