# 6001 : Hello 출력

print("Hello")

// print() 를 사용해서 출력, 문자열은 ' ' 또는 " " 로 감싸야 한다.

 

# 6002 : Hello World 출력

print("Hello World")

 

# 6003 :

Hello

World 출력

print("Hello")
print("World")

↓ 다른 방법으로는 개행 문자(\n) 사용

print("Hello\nWorld")

 

# 6004 : 'Hello' 출력

print("'Hello'")

 

# 6005 : "Hello World" 출력

print('"Hello World"')

↓ 큰따옴표(")안에서 큰따옴표(")를 출력하려면 \" 로 해야 한다.

print("\"Hello World\"")

틀린 코드

print(""Hello World"")
--> SynataxError: invalid syntax 
--> 파이썬에서 쓰지 않는 문법이라는 의미

 

# 6006 : "!@#$%^&*()' 출력

print("\"!@#$%^&*()'")

↓ 다른 정답 코드 : 작은따옴표(')안에서 작은따옴표(')를 출력하려면 \' 로 해야 한다.

print('"!@#$%^&*()\'')

 

# 6007 : "C:\Download\'hello'.py" 출력

print("\"C:\\Download\\\'hello\'.py\"")

// 백슬래시(\)를 출력하려면 앞에 백슬래시(\)를 붙여야 한다.

 

# 6008 : print("Hello\nWord") 출력

print("print(\"Hello\\nWorld\")")

 

 

https://codeup.kr/index.php

 

CodeUp

☆ 파이썬 다운로드 : 파이썬3 ☆ 무료 C언어 IDE : Code::blocks       DEV C++ ☆ 추천 온라인 IDE : C   C++11   Python3   Java ☆ 채점 가능 언어 : C, C++, JAVA, Python 3.5 ★ C++로 제출시 void main()을 사용하면

codeup.kr

'CodeUp > Python' 카테고리의 다른 글

[CodeUp] 6046-6047 (Python)  (0) 2022.11.06
[CodeUp] 6032-6045 (Python)  (0) 2022.11.05
[CodeUp] 6027-6031 (Python)  (0) 2022.11.04
[CodeUp] 6025-6026 (Python)  (0) 2022.11.03
[CodeUp] 6009-6024 (Python)  (0) 2022.11.02

# 1053 : 참 거짓 바꾸기

import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        if(a==1) {
            System.out.println("0");
        }
        else {
            System.out.println("1");
        }
        sc.close();
    }
}

 

# 1054 : 둘 다 참일 경우만 참 출력

import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        int b = sc.nextInt();
        if(a*b==1) {
            System.out.println("1");
        }
        else {
            System.out.println("0");
        }
        sc.close();
    }
}

 

# 1055 : 하나라도 참이면 참 출력

import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        int b = sc.nextInt();
        int c = a + b;
        if(c==0) {
            System.out.println("0");
        }
        else {
            System.out.println("1");
        }
        sc.close();
    }
}

 

# 1056 : 참/거짓이 서로 다를 때에만 참 출력

import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        int b = sc.nextInt();
        if(a!=b) {
            System.out.println("1");
        }
        else {
            System.out.println("0");
        }
        sc.close();
    }
}

 

# 1057 : 참/거짓이 서로 같을 때에만 참 출력

import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        int b = sc.nextInt();
        if(a==b) {
            System.out.println("1");
        }
        else {
            System.out.println("0");
        }
        sc.close();
    }
}

 

# 1058 : 둘 다 거짓일 경우만 참 출력

import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        int b = sc.nextInt();
        int c = a + b;
        if(c==0) {
            System.out.println("1");
        }
        else {
            System.out.println("0");
        }
        sc.close();
    }
}

 

https://codeup.kr/index.php

 

CodeUp

☆ 파이썬 다운로드 : 파이썬3 ☆ 무료 C언어 IDE : Code::blocks       DEV C++ ☆ 추천 온라인 IDE : C   C++11   Python3   Java ☆ 채점 가능 언어 : C, C++, JAVA, Python 3.5 ★ C++로 제출시 void main()을 사용하면

codeup.kr

'CodeUp > Java' 카테고리의 다른 글

[CodeUp] 1063-1064 (Java)  (0) 2022.11.02
[CodeUp] 1059-1062 (Java)  (0) 2022.11.01
[CodeUp] 1049-1052 (Java)  (0) 2022.10.30
[CodeUp] 1047-1048 (Java)  (0) 2022.10.29
[CodeUp] 1038-1046 (Java)  (0) 2022.10.28

# 1049 : 두 정수 입력 받아 비교

import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        int b = sc.nextInt();
        if(a>b) {
            System.out.println("1");
        }
        else {
            System.out.println("0");
        }
        sc.close();
    }
}

 

# 1050 : 두 정수 입력 받아 비교

import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        int b = sc.nextInt();
        if(a==b) {
            System.out.println("1");
        }
        else {
            System.out.println("0");
        }
        sc.close();
    }
}

 

# 1051 : 두 정수 입력 받아 비교

import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        int b = sc.nextInt();
        if(a<=b) {
            System.out.println("1");
        }
        else {
            System.out.println("0");
        }
        sc.close();
    }
}

 

# 1052 : 두 정수 입력 받아 비교

import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        int b = sc.nextInt();
        if(a!=b) {
            System.out.println("1");
        }
        else {
            System.out.println("0");
        }
        sc.close();
    }
}

 

https://codeup.kr/index.php

 

CodeUp

☆ 파이썬 다운로드 : 파이썬3 ☆ 무료 C언어 IDE : Code::blocks       DEV C++ ☆ 추천 온라인 IDE : C   C++11   Python3   Java ☆ 채점 가능 언어 : C, C++, JAVA, Python 3.5 ★ C++로 제출시 void main()을 사용하면

codeup.kr

 

'CodeUp > Java' 카테고리의 다른 글

[CodeUp] 1059-1062 (Java)  (0) 2022.11.01
[CodeUp] 1053-1058 (Java)  (0) 2022.10.31
[CodeUp] 1047-1048 (Java)  (0) 2022.10.29
[CodeUp] 1038-1046 (Java)  (0) 2022.10.28
[CodeUp] 1031-1037 (Java)  (0) 2022.10.27

# 1047 : 정수 1개 입력 받아 2배 곱해 출력

import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int num = sc.nextInt();
        System.out.println(num<<1);
        sc.close();
    }
}

 

# 1048 : 한 번에 2의 거듭제곱 배로 출력

import java.util.Scanner;

public class Main {
    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);
        sc.close();
    }
}

 

https://codeup.kr/index.php

 

CodeUp

☆ 파이썬 다운로드 : 파이썬3 ☆ 무료 C언어 IDE : Code::blocks       DEV C++ ☆ 추천 온라인 IDE : C   C++11   Python3   Java ☆ 채점 가능 언어 : C, C++, JAVA, Python 3.5 ★ C++로 제출시 void main()을 사용하면

codeup.kr

'CodeUp > Java' 카테고리의 다른 글

[CodeUp] 1053-1058 (Java)  (0) 2022.10.31
[CodeUp] 1049-1052 (Java)  (0) 2022.10.30
[CodeUp] 1038-1046 (Java)  (0) 2022.10.28
[CodeUp] 1031-1037 (Java)  (0) 2022.10.27
[CodeUp] 1028-1030 (Java)  (0) 2022.10.26

# 1038, 1039 : 정수 2개 입력 받아 합 출력

import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        long num1 = sc.nextLong();
        long num2 = sc.nextLong();
        System.out.println(num1+num2);
        sc.close();
    }
}

 

# 1040 : 정수 1개 입력 받아 부호 바꿔 출력

import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        System.out.println(a*(-1));
        sc.close();
    }
}

 

# 1041 : 문자 1개 입력 받아 다음 문자 출력

import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        char ch1 = sc.next().charAt(0);
        int ch2 = (int)ch1 + 1;
        System.out.println((char)ch2);
        sc.close();
    }
}

 

# 1042 : 정수 2개를 입력 받아 나눈 몫 출력

import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int num1 = sc.nextInt();
        int num2 = sc.nextInt();
        System.out.println(num1/num2);
        sc.close();
    }
}

 

# 1043 : 정수 2개 입력 받아 나눈 나머지 출력

import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int num1 = sc.nextInt();
        int num2 = sc.nextInt();
        System.out.println(num1%num2);
        sc.close();
    }
}

 

# 1044 : 정수 1개 입력 받아 1 더해 출력

import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        long num = sc.nextLong();
        System.out.println(num+1);
        sc.close();
    }
}

 

# 1045 : 정수 2개 입력 받아 자동 계산

import java.util.Scanner;

public class Main {
    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);
        System.out.println(a-b);
        System.out.println(a*b);
        System.out.println(a/b);
        System.out.println(a%b);
        System.out.printf("%.2f", (float)a/b);
        sc.close();
    }
}

 

# 1046 : 정수 3개 입력 받아 합과 평균 출력

import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        int b = sc.nextInt();
        int c = sc.nextInt();
        System.out.println(a+b+c);
        System.out.printf("%.1f", (float)(a+b+c)/3);
        sc.close();
    }
}

 

https://codeup.kr/index.php 

 

CodeUp

☆ 파이썬 다운로드 : 파이썬3 ☆ 무료 C언어 IDE : Code::blocks       DEV C++ ☆ 추천 온라인 IDE : C   C++11   Python3   Java ☆ 채점 가능 언어 : C, C++, JAVA, Python 3.5 ★ C++로 제출시 void main()을 사용하면

codeup.kr

 

'CodeUp > Java' 카테고리의 다른 글

[CodeUp] 1049-1052 (Java)  (0) 2022.10.30
[CodeUp] 1047-1048 (Java)  (0) 2022.10.29
[CodeUp] 1031-1037 (Java)  (0) 2022.10.27
[CodeUp] 1028-1030 (Java)  (0) 2022.10.26
[CodeUp] 1010-1027 (Java)  (0) 2022.10.25

# 1031 : 10진수 → 8진수

import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int num = sc.nextInt(); 
        String octal = Integer.toOctalString(num); // 10진수 -> 8진수
        System.out.println(octal);
        sc.close();
    }
}

 

# 1032 : 10진수 → 16진수

import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int num = sc.nextInt(); 
        String hex = Integer.toHexString(num); // 10진수 -> 16진수
        System.out.println(hex);
        sc.close();
    }
}

 

# 1033 : 10진수 → 16진수(대문자로)

import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int num = sc.nextInt(); 
        String hex = Integer.toHexString(num); // 10진수 -> 16진수
        System.out.println(hex.toUpperCase());
        sc.close();
    }
}

 

# 1034 : 8진수 → 10진수

import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String octal = sc.next();
        System.out.println(Integer.parseInt(octal,8)); // 8진수 -> 10진수
        sc.close();
    }
}

 

# 1035 : 16진수 → 8진수

import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String hex = sc.next();
        int num = Integer.parseInt(hex, 16); // 16진수 -> 10진수
        String octal = Integer.toOctalString(num); // 10진수 -> 8진수
        System.out.println(octal);
        sc.close();
    }
}

 

# 1036 : 문자  → 정수

import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        char ch = sc.next().charAt(0);
        int num = (int)ch; // 문자 -> 숫자
        System.out.println(num);
        sc.close();
    }
}

 

# 1037 : 정수  → 문자

import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int num = sc.nextInt();
        char ch = (char)num; // 숫자 -> 문자
        System.out.println(ch);
    }
}

 

https://codeup.kr/index.php

 

CodeUp

☆ 파이썬 다운로드 : 파이썬3 ☆ 무료 C언어 IDE : Code::blocks       DEV C++ ☆ 추천 온라인 IDE : C   C++11   Python3   Java ☆ 채점 가능 언어 : C, C++, JAVA, Python 3.5 ★ C++로 제출시 void main()을 사용하면

codeup.kr

'CodeUp > Java' 카테고리의 다른 글

[CodeUp] 1047-1048 (Java)  (0) 2022.10.29
[CodeUp] 1038-1046 (Java)  (0) 2022.10.28
[CodeUp] 1028-1030 (Java)  (0) 2022.10.26
[CodeUp] 1010-1027 (Java)  (0) 2022.10.25
[CodeUp] 1001-1008 (Java)  (0) 2022.10.24

※ Java 기본형 데이터타입 범위

타입 키워드 크기(bit) 범위
논리형 boolean 8(=1 byte) true, false
문자형 char 16(=2 byte) \u0000 ~ \uFFF
정수형 byte 8(=1 byte) -128 ~ 127
short 16(=2 byte) -32768 ~ 32767
int 32(=4 byte) -2147483648 ~ 2147483647
long 64(=8 byte) -9223372036854775808
~ 9223372036854775807 
실수형 float 32(=4 byte) 1.4E-45 ~ 3.4028235E38
double 64(=8 byte) 4.9E-324
~ 1.7976931348623157E308

# 1028 : 2147483648 입력 받아 출력

import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        long n = sc.nextLong();
        System.out.println(n);
        sc.close();
    }
}

// 2147483648 은 long 타입 사용

 

# 1029 : 3.14159265359 입력 받아 출력

import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        double f = sc.nextDouble();
        System.out.printf("%.11f", f);
        sc.close();
    }
}

// float는 소수 7자리까지 표현, double은 소수 16자리까지 표현

 

# 1030 : -2147483649 입력 받아 출력

import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        long n = sc.nextLong();
        System.out.println(n);
        sc.close();
    }
}

// 1028 코드와 동일

 

https://codeup.kr/index.php

 

CodeUp

☆ 파이썬 다운로드 : 파이썬3 ☆ 무료 C언어 IDE : Code::blocks       DEV C++ ☆ 추천 온라인 IDE : C   C++11   Python3   Java ☆ 채점 가능 언어 : C, C++, JAVA, Python 3.5 ★ C++로 제출시 void main()을 사용하면

codeup.kr

'CodeUp > Java' 카테고리의 다른 글

[CodeUp] 1047-1048 (Java)  (0) 2022.10.29
[CodeUp] 1038-1046 (Java)  (0) 2022.10.28
[CodeUp] 1031-1037 (Java)  (0) 2022.10.27
[CodeUp] 1010-1027 (Java)  (0) 2022.10.25
[CodeUp] 1001-1008 (Java)  (0) 2022.10.24

# 1010 : 정수 1개 입력 받아 그대로 출력하기

import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        System.out.println(n);
        sc.close();
    }
}

 

# 1011 : 문자 1개 입력 받아 그대로 출력하기

import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        char x = sc.next().charAt(0);
        System.out.println(x);
        sc.close();
    }
}

// next()로 문자열을 입력 받아 charAt(0)을 통해 첫번째 문자를 받음

 

# 1012 : 실수 1개 입력 받아 그대로 출력하기

import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        float x = sc.nextFloat();
        System.out.printf("%f", x); // 기본 소수점 6자리까지 출력
        sc.close();
    }
}

// System.out.printf("출력 서식", 출력 내용); 

 

# 1013 : 정수 2개 입력 받아 그대로 출력하기

import java.util.Scanner;

public class Main {
    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);
        sc.close();
    }
}

 

# 1014 : 문자 2개 입력 받아 그대로 출력하기

import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        char x = sc.next().charAt(0);
        char y = sc.next().charAt(0);
        System.out.println(y + " " + x);
        sc.close();
    }
}

 

# 1015 : 실수 입력 받아 둘째 자리까지 출력하기

import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        float x = sc.nextFloat();
        System.out.printf("%.2f", x);
        sc.close();
    }
}

 

# 1017 : 정수 1개 입력 받아 3번 출력하기

import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        System.out.printf("%d %d %d", a, a, a);
        sc.close();
    }
}

 

# 1018 시간 입력 받아 그대로 출력하기

import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String time[] = sc.next().split(":");
        System.out.println(time[0] + ":" + time[1]);
        sc.close();
    }
}

// split() : 구분자를 기준으로 문자열을 잘라 배열로 입력 (* 점(.)은 split("[.]") or split("\\."))

 

# 1019  : 연월일 입력 받아 그대로 출력하기 (틀린드)

import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String date[] = sc.nextLine().split("[.]");
        System.out.printf("%d"+"."+"%02d"+"."+"%02d", date[0], date[1], date[2]);
        sc.close();
    }
}

↓ 에러 : 타입에 맞지 않게 입력해서 난 에러, String으로 입력 받고, int로 출력하려고 함

Exception in thread "main" java.util.IllegalFormatConversionException: d != java.lang.String

 

# 1019  : 연월일 입력 받아 그대로 출력하기

import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String date[] = sc.nextLine().split("[.]");
        
        int year = Integer.parseInt(date[0]);
        int month = Integer.parseInt(date[1]);
        int day = Integer.parseInt(date[2]);
        
        System.out.println(String.format("%04d.%02d.%02d", year, month, day));
        sc.close();
    }
}

// Integer.parselnt() : String 타입의 숫자를 int 타입으로 변환 

 

# 1020 : 주민번호 입력 받아 형태 바꿔 출력하기

import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String number[] = sc.nextLine().split("-");
        System.out.println(number[0]+number[1]);
        sc.close();
    }
}

 

# 1021 : 단어 1개를 입력 받아 그대로 출력하기

import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String word = sc.next();
        System.out.println(word);
        sc.close();
    }
}

 

# 1022 : 문장 1개를 입력 받아 그대로 출력하기

import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String str = sc.nextLine();
        System.out.println(str);
    }
}

 

# 1023 : 실수 1개 입력 받아 부분별로 출력하기

import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String number[] = sc.next().split("[.]");
        
        int intNum = Integer.parseInt(number[0]);
        int floNum = Integer.parseInt(number[1]);
        
        System.out.println(intNum);
        System.out.println(floNum);
        sc.close();
    }
}

 

# 1024 : 단어 1개 입력 받아 나누어 출력하기

import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String word[] = sc.next().split("");
        
        for(int i=0; i<word.length; i++) {
            System.out.println("\'"+word[i]+"\'");
        }
        sc.close();
    }
}

 

# 1025 : 정수 1개 입력 받아 나누어 출력하기

import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String number[] = sc.next().split("");
        
        for(int i=0; i<number.length; i++) {
            int num = Integer.parseInt(number[i]);
            System.out.println(String.format("[%d]", num*(int)Math.pow(10,number.length-(i+1))));
        }
        sc.close();
    }
}

// Math.pow(밑, 지수) : 제곱 함수 → double 타입이기 때문에 int 타입을 원하면 형변환 해야 됨

 

# 1026 : 시분초 입력 받아 분만 출력하기

import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String time[] = sc.next().split(":");
        
        int hour = Integer.parseInt(time[0]);
        int minute = Integer.parseInt(time[1]);
        int second = Integer.parseInt(time[2]);
        
        System.out.println(minute);
        sc.close();
    }
}

 

# 1027 : 년월일 입력 받아 형식 바꿔 출력하기

import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String date[] = sc.nextLine().split("[.]");
        
        int year = Integer.parseInt(date[0]);
        int month = Integer.parseInt(date[1]);
        int day = Integer.parseInt(date[2]);
        
        System.out.printf("%02d-%02d-%04d", day, month, year);
        sc.close();
    }
}

 

https://codeup.kr/index.php

 

CodeUp

☆ 파이썬 다운로드 : 파이썬3 ☆ 무료 C언어 IDE : Code::blocks       DEV C++ ☆ 추천 온라인 IDE : C   C++11   Python3   Java ☆ 채점 가능 언어 : C, C++, JAVA, Python 3.5 ★ C++로 제출시 void main()을 사용하면

codeup.kr

'CodeUp > Java' 카테고리의 다른 글

[CodeUp] 1047-1048 (Java)  (0) 2022.10.29
[CodeUp] 1038-1046 (Java)  (0) 2022.10.28
[CodeUp] 1031-1037 (Java)  (0) 2022.10.27
[CodeUp] 1028-1030 (Java)  (0) 2022.10.26
[CodeUp] 1001-1008 (Java)  (0) 2022.10.24

+ Recent posts