Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | ||||
4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 | 19 | 20 | 21 | 22 | 23 | 24 |
25 | 26 | 27 | 28 | 29 | 30 | 31 |
Tags
- node.js
- 상속
- ArrayList
- 변수
- 인터페이스
- Java
- 코린이
- 예외 처리
- 백엔드
- 자료형
- 다형성
- 인스턴스
- 개발자
- 졸리다
- throws
- try-catch
- FileInputStream
- 문자 단위 스트림
- 배열
- 자바
- 바이트 단위 스트림
- exception
- MPA
- 초보개발자
- 파이팅
- SSR
- 보조 스트림
- 메서드
- 새벽공부
- 코딩
Archives
- Today
- Total
SHUSTORY
[ 백준 ] 9498번 : 시험 성적 _ JAVA 본문
728x90
문제
내 풀이
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int score = sc.nextInt();
switch (score/10){
case 10 :
case 9 :
System.out.println("A");
break;
case 8:
System.out.println("B");
break;
case 7:
System.out.println("C");
break;
case 6:
System.out.println("D");
break;
default:
System.out.println("F");
break;
}
}
}
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int score = sc.nextInt();
switch (score/10){
case 10 :
case 9 :
System.out.println("A");
break;
case 8:
System.out.println("B");
break;
case 7:
System.out.println("C");
break;
case 6:
System.out.println("D");
break;
default:
System.out.println("F");
break;
}
}
}
- switch-case 문 오랜만에 실습하려니까 순간 멈칫하게 되길래 기록..ㅎㅎ;;
'코딩테스트 > JAVA' 카테고리의 다른 글
[ 백준 ] 2739번 : 구구단 _ JAVA (0) | 2023.11.27 |
---|---|
[ 백준 ] 2480번 : 주사위 세개 _ JAVA (0) | 2023.11.27 |
[ 백준 ] 14681번 : 사분면 고르기 _ JAVA (1) | 2023.11.26 |
[ 백준 ] 11382번 : 꼬마 정민 _ JAVA (1) | 2023.11.25 |
[ 백준 ] 1008번 : A/B _ JAVA (0) | 2023.11.25 |