[SWEA][D1] 2063. 중간값 찾기 Java
·
알고리즘 문제풀이
import java.util.Arrays; import java.util.Scanner; class Solution { public static void main(String args[]) throws Exception { Scanner sc = new Scanner(System.in); int N; N = sc.nextInt(); int[] values = new int[N]; for (int i = 0; i
[SWEA][D1] 2058. 자릿수 더하기 Java
·
알고리즘 문제풀이
import java.util.Scanner; class Solution { public static void main(String args[]) throws Exception { Scanner sc = new Scanner(System.in); int N; N = sc.nextInt(); int sum = 0; while (N > 0){ sum = sum + (N % 10); N = N / 10; } System.out.print(sum); } }
[SWEA][D1] 2056. 연월일 달력
·
알고리즘 문제풀이
import java.util.Scanner; class Solution { public static void main(String args[]) throws Exception { Scanner sc = new Scanner(System.in); int T; T=sc.nextInt(); sc.nextLine(); for(int test_case = 1; test_case 12 ){ System.out.println("#"+test_case + " -1"); continue; } in..
[SWEA][D1] 2050. 알파벳을 숫자로 변환 Java
·
알고리즘 문제풀이
import java.util.Scanner; class Solution { public static void main(String args[]) throws Exception { Scanner sc = new Scanner(System.in); String input; input=sc.next(); for (int i = 0; i
[SWEA][D1] 2047. 신문 헤드라인 Java
·
알고리즘 문제풀이
import java.util.Scanner; class Solution { public static void main(String args[]) throws Exception { Scanner sc = new Scanner(System.in); String input; input=sc.next(); System.out.print(input.toUpperCase()); } }
[SWEA][D1] 2046. 스탬프 찍기 Java
·
알고리즘 문제풀이
import java.util.Scanner; class Solution { public static void main(String args[]) throws Exception { Scanner sc = new Scanner(System.in); int input; input=sc.nextInt(); String s = "#"; System.out.print(s.repeat(input)); } } s.repeat(input) 은 jdk8 에서 작동하지 않음 때문에 삼성 아카데미에서 원하는 답과는 다르다.import java.util.Scanner; class Solution { ..