본문 바로가기

Beakjoon&프로그래머스/Java139

[백준/Java] 11022번 A+B - 8 -Code import java.util.Scanner; public class _11022 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int t = sc.nextInt(); for(int i = 0; i < t; i++) { int a = sc.nextInt(); int b = sc.nextInt(); System.out.println("Case #" + (i + 1) + ": " + a +" + " + b + " = " + (a + b)); } } } 2022. 10. 27.
[백준/Java] 9086번 문자열 -Code import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class _9086 { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int n = Integer.parseInt(br.readLine()); for (int i = 0; i < n; i++){ String s = br.readLine(); String r1 = String.valueOf(s.charAt(0)); String .. 2022. 9. 4.
[백준/Java] 11021번 A+B - 7 -Code import java.util.Scanner; public class _11021 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); for (int i = 1; i < n + 1; i++) { int a = sc.nextInt(); int b = sc.nextInt(); System.out.println("Case #" + i + ": " + (a + b)); } } } 2022. 9. 4.
[백준/Java] 4999번 아! -Code import java.util.Scanner; public class _4999 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); String s1 = sc.next(); String s2 = sc.next(); if (s1.length() < s2.length()){ System.out.println("no"); } else { System.out.println("go"); } } } 2022. 9. 4.
[백준/Java] 10807번 개수 세기 -Code import java.util.Scanner; public class _10807 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int[] list = new int[n]; for (int i = 0; i < n; i++){ list[i] = sc.nextInt(); } int v = sc.nextInt(); int cnt = 0; for (int num : list) { if (num == v){ cnt += 1; } } System.out.println(cnt); } } 2022. 8. 27.
[백준/Java] 10872번 팩토리얼 -Code import java.util.Scanner; public class _10872 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int result = 1; for (int i = 1; i 2022. 8. 27.