JAVA/JAVA Algorithm, Datastruct

    [Algorithm] JAVA 코드업 기초 100제 (기초-비트단위논리연산) 1059 ~ 1062

    비트단위(bitwise)연산자 ~(bitwise not) &(bitwise and) |(bitwise or) ^(bitwise xor) (bitwise right shift) 1059 : [기초-비트단위논리연산] 비트단위로 NOT 하여 출력하기(설명) public static void main(String[] args) { Scanner sc = new Scanner(System.in); int s = sc.nextInt(); System.out.printf("%d",~s); } 1060 : [기초-비트단위논리연산] 비트단위로 AND 하여 출력하기(설명) public static void main(String[] args) { Scanner sc = new Scanner(System.in); String..

    [Algorithm] JAVA 코드업 기초 100제 (기초-논리연산) 1053 ~ 1058

    1053 : [기초-논리연산] 참 거짓 바꾸기(설명) public static void main(String[] args) { Scanner sc = new Scanner(System.in); int i = sc.nextInt(); if(i == 1) { System.out.println(0); }else { System.out.println(1); } } 1054 : [기초-논리연산] 둘 다 참일 경우만 참 출력하기(설명) public static void main(String[] args) { Scanner sc = new Scanner(System.in); String s = sc.nextLine(); if(1==Integer.parseInt(s.substring(s.indexOf(" ")+1)) ..

    [Algorithm] JAVA 코드업 기초 100제 (기초-비교연산) 1049 ~ 1052

    1049 : [기초-비교연산] 두 정수 입력받아 비교하기1(설명) public static void main(String[] args) { Scanner sc = new Scanner(System.in); String s = sc.nextLine(); if(Integer.parseInt(s.substring(s.indexOf(0)+1, s.indexOf(" ")))>Integer.parseInt(s.substring(s.indexOf(" ")+1))) { System.out.println(1); }else { System.out.println(0); } } 1050 : [기초-비교연산] 두 정수 입력받아 비교하기2(설명) public static void main(String[] args) { Scann..

    [Algorithm] JAVA 코드업 기초 100제 (기초-비트시프트연산) 1047 ~ 1048

    1047 : [기초-비트시프트연산] 정수 1개 입력받아 2배 곱해 출력하기(설명) public static void main(String[] args) { Scanner sc = new Scanner(System.in); int i = sc.nextInt(); System.out.printf("%d", i

    [Algorithm] JAVA 코드업 기초 100제 (기초-산술연산) 1038 ~ 1046

    1038 : [기초-산술연산] 정수 2개 입력받아 합 출력하기1(설명) public static void main(String[] args) { Scanner sc = new Scanner(System.in); String s = sc.nextLine(); System.out.print( Integer.parseInt(s.substring(s.indexOf(" ") + 1)) + Integer.parseInt(s.substring(s.indexOf(0)+1,s.indexOf(" ")))); } 1039 : [기초-산술연산] 정수 2개 입력받아 합 출력하기2(설명) public static void main(String[] args) { Scanner sc = new Scanner(System.in); S..