[JAVA] 백준 2675번 : 문자열 반복
·
Computer Science/자료구조와 알고리즘
1. 문제 문자열 S를 입력받은 후에, 각 문자를 R번 반복해 새 문자열 P를 만든 후 출력하는 프로그램을 작성하시오. 즉, 첫 번째 문자를 R번 반복하고, 두 번째 문자를 R번 반복하는 식으로 P를 만들면 된다. 2. 코드 import java.util.Scanner; public class Main { public static void main(String[] args) { // TODO Auto-generated method stub Scanner sc = new Scanner(System.in); int n= sc.nextInt(); for(int i=0;i
[Algorithm] Exhaustive Search(완전검색), Greedy Algorithm(탐욕 알고리즘), Sort(정렬)
·
Computer Science/자료구조와 알고리즘
보호되어 있는 글입니다.
non-void function does not return a value in all control paths [-Wreturn-type]
·
Computer Science/기타 error
원인 함수의 리턴형이 int라고 지정하고 리턴을 하지않거나 리턴되는 값이 없을 경우가 생길 때,, "non-void function does not return a value in all control paths " 라는 경고가 생김 해결방법 return값이 없을 경우, return 0;
[Digital circuit] notepad++ - verilog 에러 : No such file or directory No top level modules, and no -s option
·
Computer Science/Digital circuit
Notepad++ console창에 "iverilog -o functions functions.v functions_tb.v" 를 실행시켰는데, "No such file or directory No top level modules, and no -s option"라는 에러가 발생하였다. path설정도 잘 했고, file을 만들어 저장까지 완료하였는데 해당 에러가 발생한다?? workspace가 다른곳에 설정되어있기 때문이다. (해결방안) workspace를 해당 파일이 있는 폴더로 설정해 주거나, 파일들을 notepad++폴더에 넣어주어야한다.
[Digital Circuit] algebraic structures에 사용되는 Basic Common Postulates (cf. 분배법칙 증명)
·
Computer Science/Digital circuit
1. Closure - 정의) A set S is closed with respect to a binary operator if, for every pair of elements of S, the binary operator specifies a rule for obtaining a unique elements of S 2. Associate law(결합법칙) - (x*y)*z=x*(y*z) for all x,y,z∈S 3. Commutative law(교환법칙) - x*y=y*x for all x,y∈S 4. Identity elements(항등원) - for all x∈S, e*x=x*e=x 5. Inverse(역원) - for all x∈S , exists y∈S, such that x*y=e 이때..