https://www.acmicpc.net/problem/2753 2753번: 윤년 연도가 주어졌을 때, 윤년이면 1, 아니면 0을 출력하는 프로그램을 작성하시오. 윤년은 연도가 4의 배수이면서, 100의 배수가 아닐 때 또는 400의 배수일 때이다. 예를 들어, 2012년은 4의 배수이면서 www.acmicpc.net 문제를 보며 유의해야 할 점은 '윤년은 4의 배수이면서, 100의 배수가 아닐 때 또는 400의 배수일 때이다.' 문제 흐름 상 100의 배수도 윤년이구나 하며 풀었는데 자세히 보니 100의 배수가 아닐 때였다. 정답 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 import java.util.Scanner; public class Main{ ..
https://www.acmicpc.net/problem/10171 10171번: 고양이 아래 예제와 같이 고양이를 출력하시오. www.acmicpc.net 정답 1 2 3 4 5 6 7 8 9 10 public class Main { public static void main(String[] args) { System.out.println("\\ /\\"); System.out.println(" ) ( ')"); System.out.println("( / )"); System.out.println(" \\(__)|"); } } Colored by Color Scripter cs 자바에서 몇몇 문자는 단독으로 써서 출력할 수 없다. ex) \ , "" 그렇기 때문에 문자를 출력하기 위해 조합을 만들어 출..
https://www.acmicpc.net/problem/2588 2588번: 곱셈 첫째 줄부터 넷째 줄까지 차례대로 (3), (4), (5), (6)에 들어갈 값을 출력한다. www.acmicpc.net 백준 알고리즘 2588번 문제풀이이다. 정답 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 import java.util.Scanner; public class Main { public static void main(String[] args){ Scanner sc = new Scanner(System.in); int A = sc.nextInt(); int B = sc.nextInt(); System.out.println(A*(B%10)); System.out.println(..
https://www.acmicpc.net/problem/10430 10430번: 나머지 첫째 줄에 A, B, C가 순서대로 주어진다. (2 ≤ A, B, C ≤ 10000) www.acmicpc.net 백준 알고리즘 10430번 문제 풀이이다. 정답 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 import java.util.Scanner; public class Main { public static void main(String[] args){ Scanner sc = new Scanner(System.in); int A = sc.nextInt(); int B = sc.nextInt(); int C = sc.nextInt(); System.out.println((A+B)%C..