본문 바로가기

전체 글191

23.05.03 2차원 배열, 다차원 배열, 순회 package nadocoding.Chap_04; public class _11_Continue { public static void main(String[] args) { // Continue // 치킨 주문 손님중에 노쇼 손님이 있다고 가정 // For int max = 20; int sold = 0; int noShow = 17; for (int i = 1; i 2 * 2 = 4 // 3 -> 3 * 3 = 9 // 2 = Argument, 인수 power(2); // 2 의 2 승은 4 power(3); // 3 의 2 승은 9 powerByExp(3,3); // 3 의 3 승은 27 powerByExp(2,5); // 2 의 5 승은 32 powerByExp(1.. 2023. 5. 3.
23.05.02 continue package nadocoding.Chap_04; public class _11_Continue { public static void main(String[] args) { // Continue // 치킨 주문 손님중에 노쇼 손님이 있다고 가정 // For int max = 20; int sold = 0; int noShow = 17; for (int i = 1; i 2023. 5. 2.
23.05.01 문자열 관련 함수(.length(), .indexOf(), .substring(), ...) package nadocoding.Chap_03; public class _01_String1 { public static void main(String[] args) { String s = "I like Java and Python and C."; System.out.println(s); // 문자열의 길이 System.out.println(s.length()); // 29 // 대소문자 변환 System.out.println(s.toUpperCase()); // I LIKE JAVA AND PYTHON AND C. System.out.println(s.toLowerCase()); // i like java a.. 2023. 5. 1.
23.04.28 연산자 package nadocoding.Chap_02; public class _01_Operator1 { public static void main(String[] args) { // 산술 연산자 // 일반 연산 System.out.println(4 + 2); // 6 System.out.println(4 - 2); // 2 System.out.println(4 * 2); // 8 System.out.println(4 / 2); // 2 System.out.println(5 / 2); // 2 System.out.println(2 / 4); // 0 System.out.println(4 % 2); // 0 System.out.println(5 % 2); // 1 // 우선 순위 연산 System.ou.. 2023. 4. 28.