반응형 코딩테스트8 백준 14681번 사분면 고르기-자바(JAVA)_BufferedReader 1. BufferedReader를 이용한 방법 import java.io.*;import java.util.Scanner;public class Main { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int x = Integer.parseInt(br.readLine()); int y = Integer.parseInt(br.readLine()); if (x > 0) { if (y > 0) { System.out.println(1); } els.. 2024. 7. 12. 백준 2753번 윤년 -자바(JAVA) JAVAimport java.util.Scanner;public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int A = sc.nextInt(); if (A % 4 == 0 && A % 100 != 0 || A % 400 == 0 ) { // 4의 배수 이면서 100의 배수가 아닐 때 또는 400의 배수일 때 System.out.println("1"); }else System.out.println("0"); }} 2024. 7. 12. 이전 1 2 다음 반응형