package choongang;

import java.util.Scanner;

public class IF001 {

	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		
		int kor = 0;
		int eng = 0;
		int math = 0;
		String grad = "";
		
		int tot = 0;
		double avg = 0;
		
		System.out.print("국어>");
		kor = Integer.parseInt(scan.nextLine());
		System.out.print("영어>");
		eng = Integer.parseInt(scan.nextLine());
		System.out.print("수학>");
		math = Integer.parseInt(scan.nextLine());
		
		tot = kor + eng + math;
		avg = tot / 3.0;
		
		grad = (kor >=60) ? "합격" : "불합격";
		System.out.printf("국어점수: %d (%s)\n", kor, grad);
		grad = (eng >=60) ? "합격" : "불합격";
		System.out.printf("영어점수: %d (%s)\n", eng, grad);
		grad = (math >=60) ? "합격" : "불합격";
		System.out.printf("수학점수: %d (%s)\n", math, grad);
		
		grad += tot;
		System.out.println("총점:" + tot);
		grad = (avg >=60) ? "합격" : "불합격";
		System.out.printf("평균: %.2f (%s)\n", avg, grad);
		
		
	}

}

 

+ Recent posts