CS

· CS/BaekJoon
🎈문제 https://www.acmicpc.net/problem/14681 💬설명 두 숫자를 입력받아 몇사분면인지 출력해보자 if, else if, else 조건문을 살펴보자 ⌨️ CODE import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int x = sc.nextInt(); int y = sc.nextInt(); if(x>0 && y>0) { System.out.println("1"); }else if(x>0 && y
· CS/BaekJoon
🎈문제 https://www.acmicpc.net/problem/2753 💬설명 입력받은 숫자에 따라 윤년인지 아닌지 출력해보자 if, else if, else 조건문을 살펴보자 ⌨️ CODE import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int k = sc.nextInt(); if(((k%4==0) && !(k%100 == 0)) || k%400 == 0) { System.out.println(1); }else { System.out.println(0); } } }
· CS/BaekJoon
🎈문제 https://www.acmicpc.net/problem/9498 💬설명 Print에 입력받은 숫자에 따라 학점을 출력해보자 if, else if, else 조건문을 살펴보자 ⌨️ CODE import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int k = sc.nextInt(); String r = ""; if(k >= 90 && k = 80 && k = 70 && k = 60 && k
· CS/BaekJoon
🎈문제 https://www.acmicpc.net/problem/1330 💬설명 Print에 두 값을 비교하여 출력해보자 ⌨️ CODE import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); float A = sc.nextFloat(); float B = sc.nextFloat(); if(A > B) { System.out.println(">"); }else if(A < B) { System.out.println("
🔔벨91
'CS' 카테고리의 글 목록 (14 Page)