감자튀김 공장🍟

[CodeUp]JAVA 1022~1031 본문

Algorithm/CodeUp

[CodeUp]JAVA 1022~1031

Potato potage 2021. 3. 13. 00:58
반응형

[1022]

import java.util.Scanner;

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

        String data = scanner.nextLine();
        System.out.println(data);
    }
}

 

 

[1023]

import java.util.Scanner;

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

        String data = scanner.next();
        String a[] = data.split("[.]");
        System.out.println(a[0] + "\n" + a[1]);
    }
}

 

 

[1024]

import java.util.Scanner;

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

        String data = scanner.nextLine();

        for(int i = 0; i < data.length(); i++) {
            System.out.println("\'" + data.charAt(i) + "\'");
        }
    }
}

 

 

[1025]

import java.util.Scanner;

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

        String data = scanner.nextLine();

        for(int i = 0; i < data.length(); i++) {
            System.out.print(data.charAt(i));

            for(int j = data.length() -1; j > i; j--) {
                System.out.print("0");
            }
            System.out.println();
        }
    }
}

 

 

[1026]

import java.util.Scanner;

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

        String data = scanner.next();
        String a [] = data.split(":");

        System.out.println(a[1]);
    }
}

 

 

[1027]

import java.util.Scanner;

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

        String data = scanner.nextLine();
        String a [] = data.split("[.]");

        System.out.println(a[2] + "-" + a[1] + "-" + a[0]);
    }
}

 

 

[1028]

import java.util.Scanner;

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

	// int는 -2^31 ~ 2^31-1까지, 양수 0 ~ 2^32-1 로도 사용 가능
        // long은 -2^63 ~ 2^63-1까지, 양수 0 ~ 2^64-1 로도 사용 가능
        long a = scanner.nextLong(); 
        System.out.println(a);
    }
}

 

 

[1029]

import java.util.Scanner;

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

        double a = scanner.nextDouble();
        System.out.printf("%.11f", a);
    }
}

 

 

[1030]

import java.util.Scanner;

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

        long a = scanner.nextLong();
        System.out.println(a);
    }
}

 

 

[1031]

import java.util.Scanner;

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

        int a = scanner.nextInt();
        String b = Integer.toOctalString(a);

        System.out.println(b);
    }
}
반응형

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

[Codeup]JAVA 1052~1061  (0) 2021.03.15
[CodeUp]JAVA 1042~1051  (0) 2021.03.14
[CodeUp]JAVA 1032~1041  (0) 2021.03.13
[CodeUP]JAVA 1012~1021  (0) 2021.03.12
[CodeUp]JAVA 1001~1011  (0) 2021.03.11
Comments