[SWEA][D1] 2046. 스탬프 찍기 Java
·
Coding/알고리즘 문제풀이
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 { ..
[SWEA][D1] 2029. 몫과 나머지 출력하기 Java
·
Coding/알고리즘 문제풀이
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(); for(int test_case = 1; test_case
[SWEA][D1] 2019. 더블더블 Java
·
Coding/알고리즘 문제풀이
import java.util.Scanner; class Solution { public static void main(String args[]) throws Exception { Scanner sc = new Scanner(System.in); int value; value=sc.nextInt(); int doubledouble = 1; System.out.print(doubledouble); for(int i = 0; i
[SWEA][D1] 1936. 1대1 가위바위보 Java
·
Coding/알고리즘 문제풀이
import java.util.Scanner;import java.io.FileInputStream;class Solution{ public static void main(String args[]) throws Exception { Scanner sc = new Scanner(System.in); int AValue; int BValue; AValue = sc.nextInt() - 2 ; BValue = sc.nextInt() - 2; if( AValue + BValue == 0 ){ if(AValue > BValue){ System.out.print("B"); }else ..
[SWEA][D1] 1933. 간단한 N 의 약수 JAVA
·
Coding/알고리즘 문제풀이
import java.util.Scanner; import java.io.FileInputStream; class Solution { public static void main(String args[]) throws Exception { Scanner sc = new Scanner(System.in); int Value; Value = sc.nextInt(); for (int i = 1; i
[SWEA][D1] 2043. 서랍의 비밀번호 Java
·
Coding/알고리즘 문제풀이
import java.util.Scanner; class Solution { public static void main(String args[]) throws Exception { Scanner sc = new Scanner(System.in); int password; password =sc.nextInt(); int K; K = sc.nextInt(); if(password > K){ System.out.print(password - K + 1); return; } if (password ==..