휴지통665 백준 10171 (고양이) public class Main10171 { public static void main(String[] args) { //10171 System.out.println("\\ /\\"); System.out.println(" ) ( ')"); System.out.println("( / )"); System.out.println(" \\(__)|"); } } 이스케이프 문자 \는 print문에서 출력을 하려면 \\이런식으로 두 개를 붙여야 한다. "\\"-> 실제 출력시 "\" 2021. 6. 28. 백준 1008 import java.util.Scanner; public class Main1008 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int A =sc.nextInt(); int B = sc.nextInt(); System.out.println((double)A/B); } } 2021. 6. 28. 백준 1001 import java.util.Scanner; public class Main1001 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int A = sc.nextInt(); int B =sc.nextInt(); System.out.println(A-B); } } 2021. 6. 28. 백준 1000 import java.util.Scanner; public class Main1000 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int A = sc.nextInt(); int B = sc.nextInt(); System.out.println(A+B); } } 백준코드에 넣을 시 클래스 이름은 Main으로만 해야된다. 2021. 6. 28. 이진 트리 (2) package NodeMgmtTest; //Node클래스가 겹쳐서 따로만듬 //노드 클래스 만들기 class Node{ Node left; Node right; int value; Node(int data) { this.value = data; this.left = null; this.right = null; } } public class NodeMgmt { //트리(Tree)의 구조 //트리 : Node와 Branch를 이용해서, 사이클을 이루지 않도록 구성한 데이터 구조 //Branch : 노드와 노드를 연결 //실제 사용 처 : //트리 중 이진 트리(Binary Tree) 형태의 구조로, 탐색(검색) 알고리즘 구현을 위해 많이 사용된다. // //용어 : //Node : 트리에서 데이터를 저장하는.. 2021. 6. 28. 이진 트리 (1) 이진 트리의 개념및 데이터 삽입 public class NodeMgmt { //트리(Tree)의 구조 //트리 : Node와 Branch를 이용해서, 사이클을 이루지 않도록 구성한 데이터 구조 //Branch : 노드와 노드를 연결 //실제 사용 처 : //트리 중 이진 트리(Binary Tree) 형태의 구조로, 탐색(검색) 알고리즘 구현을 위해 많이 사용된다. // //용어 : //Node : 트리에서 데이터를 저장하는 기본요소(데이터와 다른 연결된 노드에 대한 Branch 정보도 포함한다) //Root Node : 트리 맨 위에 있는 노드 (최상위 노드) //Level : 최상위 노드를 Level 0으로 하였을 때, 하위 Branch로 연결된 노드의 깊이를 나타낸다. //Parent Node : 어.. 2021. 6. 28. 이전 1 ··· 99 100 101 102 103 104 105 ··· 111 다음