반응형
1021번 ~ 1022번
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class Main {
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
String word= br.readLine();
System.out.print(word);
}
}
1023번
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class Main {
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
String[] result = br.readLine().split("\\.");
System.out.print(result[0] + "\n" + result[1]);
}
}
1024번
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class Main {
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
String word = br.readLine();
for (int i = 0; i < word.length(); i++) {
System.out.println("'" + word.charAt(i) + "'");
}
}
}
1025번
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class Main {
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
String[] numbers = br.readLine().split("");
System.out.println("[" + Integer.parseInt(numbers[0]) * 10000 + "]");
System.out.println("[" + Integer.parseInt(numbers[1]) * 1000 + "]");
System.out.println("[" + Integer.parseInt(numbers[2]) * 100 + "]");
System.out.println("[" + Integer.parseInt(numbers[3]) * 10 + "]");
System.out.println("[" + Integer.parseInt(numbers[4]) + "]");
}
}
반응형
'알고리즘 > 코드업 기초 100제' 카테고리의 다른 글
[JAVA]코드업 1031번 ~ 1035번 (0) | 2021.04.29 |
---|---|
[JAVA]코드업 1026번 ~ 1030번 (0) | 2021.04.29 |
[JAVA]코드업 1016번 ~ 1020번 (0) | 2021.04.27 |
[JAVA]코드업 1011번 ~ 1015번 (0) | 2021.04.27 |
[JAVA]코드업 1006번 ~ 1010번 (0) | 2021.04.27 |