목록Programming/Coding Test Practice (11)
헬린코린이

import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class Main { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); String input = br.readLine(); StringBuffer sb = new StringBuffer(input); String result = sb.reverse().toString(); if(input.equals(result)){ System.out...

import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.StringTokenizer; public class Main{ public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); StringTokenizer st = new StringTokenizer(br.readLine()); int N = Integer.parseInt(st.nextToken()), M = Integer.parseIn..

import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class Main { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); String Dialing = br.readLine(); int count = 0; for (int i = 0; i < Dialing.length(); i++) { int test = Dialing.charAt(i); if (test < 68) count += 3; el..

import java.util.Scanner; import java.util.StringTokenizer; public class Main { public static void main(String[] args) { Scanner scan = new Scanner(System.in); String result = scan.nextLine(); StringTokenizer st = new StringTokenizer(result," "); System.out.println(st.countTokens()); } }

import java.util.Scanner; public class Main{ public static void main(String[] args) { Scanner scan = new Scanner(System.in); int T = scan.nextInt(); for (int i = 0; i < T; i++) { int R = scan.nextInt(); String S = scan.next(); for (int k = 0; k < S.length(); k++) { for (int j = 0; j < R; j++) { System.out.print(S.charAt(k)); } } System.out.println(); } } }

비교적 쉬운 문제인데 입력에 10^12 사이라고 되어있는데 처음에 Int로 받아 int범위를 초과한 값이 입력돼서... InputMismatchException이 계속 발생했다.... ㅎㄷㄷ... import java.util.Scanner; public class Main{ public static void main(String[] args){ Scanner sc = new Scanner(System.in); long a = sc.nextLong(); long b = sc.nextLong(); long c = sc.nextLong(); System.out.println(a+b+c); } }

import java.util.Scanner; public class Main{ public static void main(String[] args){ Scanner scanner = new Scanner(System.in); int n = scanner.nextInt(); System.out.print(1-n+" "); n = scanner.nextInt(); System.out.print(1-n+" "); n = scanner.nextInt(); System.out.print(2-n+" "); n = scanner.nextInt(); System.out.print(2-n+" "); n = scanner.nextInt(); System.out.print(2-n+" "); n = scanner.nextI..

import java.util.Scanner; public class Main{ public static void main(String[] args){ Scanner sc = new Scanner(System.in); int N = sc.nextInt(); int[] arrays = new int[N]; int maxValue = 0; int minValue = 0; for(int i=0; i

import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc=new Scanner(System.in); int d1=sc.nextInt(); int d2=sc.nextInt(); int d3=sc.nextInt(); if(d1==d2 && d2==d3) { System.out.println((10000+d1*1000)); } else if(d1==d2 || d2==d3 || d3==d1) { if(d1==d2) { System.out.println((1000+d1*100)); } else { System.out.println((1000+d3*100)); } } else { if(d1>=d2 ..