큐범
Just do debug
큐범
전체 방문자
오늘
어제
  • 전체보기 (128)
    • 회고 (4)
    • JAVA (16)
      • JAVA 기초 (18)
      • JAVA Algorithm, Datastruct (13)
    • Spring (11)
    • Micro Service Architecture (3)
    • JPA (6)
    • gRPC (4)
    • Network (8)
    • Process (7)
    • Cloud (4)
    • Python (10)
    • Web(vue) (2)
    • UMC (1)
    • DB (9)
    • CS (1)
    • Clean Code (1)
    • TDD (9)

블로그 메뉴

  • 홈
  • 태그
  • 방명록

인기 글

최근 댓글

최근 글

hELLO · Designed By 정상우.
큐범

Just do debug

JAVA/JAVA Algorithm, Datastruct

[Algorithm] JAVA 코드업 기초 100제 (기초-출력변환) 1031 ~ 1037

2022. 8. 28. 15:27

1031 : [기초-출력변환] 10진 정수 1개 입력받아 8진수로 출력하기(설명)

public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    System.out.println(Integer.toOctalString(sc.nextInt()));
}

1032 : [기초-출력변환] 10진 정수 입력받아 16진수로 출력하기1(설명)

public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    System.out.println(Integer.toHexString(sc.nextInt()));
}

1033 : [기초-출력변환] 10진 정수 입력받아 16진수로 출력하기2(설명)

public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);

    //방법1
    int i=sc.nextInt();
    System.out.printf("%X",i);

    //방법2
    System.out.println(Integer.toHexString(i).toUpperCase());
}

1034 : [기초-출력변환] 8진 정수 1개 입력받아 10진수로 출력하기(설명)

public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);

    String i = sc.next();

    System.out.println(Integer.parseInt(i,8));
}

1035 : [기초-출력변환] 16진 정수 1개 입력받아 8진수로 출력하기(설명)

public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);

    String i = sc.next();

    int n = Integer.valueOf(i,16);

    System.out.printf("%o",n);
}

1036 : [기초-출력변환] 영문자 1개 입력받아 10진수로 출력하기(설명)

public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);

    char s = sc.next().charAt(0);
    System.out.print((int)s);
}

1037 : [기초-출력변환] 정수 입력받아 아스키 문자로 출력하기

public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);

    int i = sc.nextInt();

    System.out.print((char) i);
}
    'JAVA/JAVA Algorithm, Datastruct' 카테고리의 다른 글
    • [Algorithm] JAVA 코드업 기초 100제 (기초-비트시프트연산) 1047 ~ 1048
    • [Algorithm] JAVA 코드업 기초 100제 (기초-산술연산) 1038 ~ 1046
    • [Algorithm] JAVA 코드업 기초 100제 (기초-데이터형) 1028 ~ 1030
    • [JAVA]알고리즘 입문 (최솟값 최댓값)
    큐범
    큐범

    티스토리툴바