import java.io.*;import java.util.*; class Main { public static void main(String[] args) throws IOException { BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); String[] firstLine = in.readLine().split(" "); final int aRadix = Integer.parseInt(firstLine[0]); final int bRadix = Integer.parseInt(firstLine[1]); int secondLine = Integer.parseInt(in.readLine()); String[] thirdL..
import java.io.BufferedReader;import java.io.IOException;import java.io.InputStreamReader;import java.util.Stack; class Main { public static void main(String[] args) throws IOException { BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); Stack stack = new Stack(); int input = Integer.parseInt(in.readLine()); final int dividor = -2; if(input == 0) { System.out.println(0); r..
https://soojin.ro/blog/naming-boolean-variables Bool 변수의 이름을 지을 때 항상 is??? 처럼 쓰긴 했는데, 문장으로 썼을 때 보어가 아닌 목적어를 포함하게 되는 문장에선 is??? 같은 이름이 어울리지 않을 때가 있다. 위의 주소에서 예전에 Bool 변수 이름 짓는 팁을 읽었는데, 정리를 해두어야 할 것 같다. [is 용법] -> 문장으로 썼을 때 보어를 포함하는 경우 is + 명사(명사)인가?func isDescendant(of view: UIView) -> Bool : 이것이 인자로 들어온 UIView의 자식인가?is + ~ing~하는 중인가?var isExecuting: Bool { get } : 현재 작업이 진행중인가?var isPending: Boo..
forEach 메소드나 for-in 루프나 요소를 차례대로 돌아가면서 접근한다는 것은 같은데forEach 메소드는 그 작업을 클로저에서 행한다. 문서 아래에 forEach 메소드와 for-in 구문의 중요한 차이점을 기술한 부분이 있다. - forEach 메소드에서는 클로저를 빠져나가거나 다음 호출을 건너뛰기 위해 break나 continue를 사용할 수 없다.- forEach 메소드의 클로저 안에서 return을 호출하는 것은 어떤 외부 스코프를 빠져나가는 것이 아닌, 현재 클로저 호출을 빠져나갈 뿐이고, 다음 호출을 건너뛰지 않는다. ??? 플레이그라운드에서 실험해보기로 했다. let numbers = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]numbers.forEach { (numbe..
import java.io.BufferedReader;import java.io.IOException;import java.io.InputStreamReader;import java.util.Stack; class Main { public static void main(String[] args) throws IOException { BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); Stack stack = new Stack(); Stack result = new Stack(); String input = in.readLine(); int size = input.length(); if(size == 1 && input.equ..
import java.io.BufferedReader;import java.io.IOException;import java.io.InputStreamReader;import java.util.Stack; class Main { public static void main(String[] args) throws IOException { BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); Stack stack = new Stack(); String input = in.readLine(); int size = input.length(); for(int i=size-1; i>=0; i = i-3) { int a = (int)input..
import java.io.BufferedReader;import java.io.IOException;import java.io.InputStreamReader; class Main { public static void main(String[] args) throws IOException { BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); String[] input = in.readLine().split(" "); String n = input[0]; int b = Integer.parseInt(input[1]); int lengthOfN = n.length(); int result = 0; for(int i=length..
import java.io.BufferedReader;import java.io.IOException;import java.io.InputStreamReader; class Main { public static void main(String[] args) throws IOException { BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); String[] input = in.readLine().split(" "); long n = Long.parseLong(input[0]); int b = Integer.parseInt(input[1]); solve(n, b); System.out.println(); } static vo..
import java.io.BufferedReader;import java.io.IOException;import java.io.InputStreamReader; class Main { public static void main(String[] args) throws IOException { BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); int count = Integer.parseInt(in.readLine()); String[] cases = new String[count]; for(int i=0; i
import java.io.BufferedReader;import java.io.IOException;import java.io.InputStreamReader; class Main { public static void main(String[] args) throws IOException { BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); int count = Integer.parseInt(in.readLine()); String[] cases = new String[count]; for(int i=0; i