View

1021

        //1021번 문제
        Scanner Input = new Scanner(System.in);
        char[] data = Input.next().toCharArray();
        System.out.print(data);

1022

        //1022번 문제
        Scanner Input = new Scanner(System.in);
        char[] data = Input.nextLine().toCharArray();
        System.out.print(data);      

1023

        //1023번 문제
        Scanner Input = new Scanner(System.in);
        String[] str = Input.nextLine().split("\\.");

        int x = Integer.parseInt(str[0]);
        int y = Integer.parseInt(str[1]);

        System.out.printf("%d",x);
        System.out.println();
        System.out.printf("%d",y);

        //1024번 문제
        Scanner Input = new Scanner(System.in);
        char[] d = new char[30];
        String str = Input.next();

        for(int i = 0; i<str.length(); i++){
            d[i] = str.charAt(i);
            System.out.printf("\'%c\'%n", d[i]);
        }

1024

1025

        //1025번 문제
        Scanner Input = new Scanner(System.in);
        String str = Input.next();

        for(int i = 0; i< str.length(); i++){
            int length = str.length();
            int a = (int) Math.pow(10, (length - i - 1));
            //입력한 문자의 ASCII Value - '0'(48) = 원래 값
            int b = (str.charAt(i) - '0' )*a;

            System.out.printf("[%d]%n", b);
        }

1026

      //1026번 문제
      Scanner Input = new Scanner(System.in);
      String[] str = (Input.nextLine()).split(":");
      System.out.printf("%d:%d:%d",Integer.parseInt(str[0]),Integer.parseInt(str[1]),Integer.parseInt(str[2]));  

1027

        //1027번 문제
        Scanner Input = new Scanner(System.in);
        String[] str = (Input.nextLine()).split("\\.");
        int year = Integer.parseInt(str[0]);
        int month = Integer.parseInt(str[1]);
        int day = Integer.parseInt(str[2]);

        System.out.printf("%02d-%02d-%04d",day,month,year);

1028

        //1028번 문제
        Scanner Input = new Scanner(System.in);
        long data = Input.nextInt();

        System.out.print(data);

1029

        //1029번 문제
        Scanner Input = new Scanner(System.in);
        double d = Input.nextDouble();
        System.out.printf("%.11f", d);

1030

        //1030번 문제
        Scanner Input = new Scanner(System.in);
        long data = Input.nextLong();
        System.out.println(data);

1031

        //1031번 문제
        Scanner Input = new Scanner(System.in);
        int data = Input.nextInt();
        System.out.printf("%o",data);

1032

        //1032번 문제
        Scanner Input = new Scanner(System.in);
        int data  = Input.nextInt();
        System.out.printf("%x",data);

1033

        //1033번 문제
        Scanner Input = new Scanner(System.in);
        int data  = Input.nextInt();
        System.out.printf("%X",data);

1034

        //1034번 문제
        Scanner Input = new Scanner(System.in);
        int Data  = Input.nextInt();
        String ChangeData = Integer.toOctalString(Data);
        System.out.println(ChangeData);

1035

        //1035번 문제
        Scanner Input = new Scanner(System.in);
        String Data  = Input.next(); //16진수 입력
        int temp = Integer.parseInt(Data, 16);// 문자열을 16진수로 바꿈
        String ChangeData = Integer.toOctalString(temp);

        System.out.println(ChangeData);

1036

        //1036번 문제
        Scanner Input = new Scanner(System.in);
        char Data = Input.next().charAt(0);

        System.out.printf("%d", (int)Data);

1037

       //1037번 문제
        Scanner Input = new Scanner(System.in);
        int Data = Input.nextInt();

        System.out.printf("%c", (char)Data);

1038

        //1038번 문제
        Scanner Input = new Scanner(System.in);
        String str = Input.nextLine();
        String[] ParseStr = str.split(" ");
        int x = Integer.parseInt(ParseStr[0]);
        int y = Integer.parseInt(ParseStr[1]);

        System.out.printf("%d", x+y);

1039

        //1039번 문제
        Scanner Input = new Scanner(System.in);
        String str = Input.nextLine();
        String[] ParseStr = str.split(" ");
        long x = Long.parseLong(ParseStr[0]);
        long y = Long.parseLong(ParseStr[1]);

        System.out.printf("%d", x+y);

1040

        //1040번 문제
        Scanner Input = new Scanner(System.in);
        int data = Input.nextInt();

        System.out.printf("%d",-data);
Share Link
reply
«   2024/12   »
1 2 3 4 5 6 7
8 9 10 11 12 13 14
15 16 17 18 19 20 21
22 23 24 25 26 27 28
29 30 31