반응형
1026번
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[] times = br.readLine().split(":");
if (times[1].length() > 1 && times[1].charAt(0) == '0') {
System.out.println(times[1].charAt(1));
} else {
System.out.println(times[1]);
}
}
}
1027번
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[] times = br.readLine().split("\\.");
System.out.println(times[2] + "-" + times[1] + "-" + times[0]);
}
}
1028번
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.math.BigInteger;
public class Main {
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
BigInteger bigInteger = new BigInteger(br.readLine());
System.out.println(bigInteger);
}
}
1029번
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.math.BigDecimal;
public class Main {
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
BigDecimal bigDecimal = new BigDecimal(br.readLine());
System.out.println(bigDecimal.setScale(11));
}
}
1030번
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.math.BigInteger;
public class Main {
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
BigInteger bigInteger = new BigInteger(br.readLine());
System.out.println(bigInteger);
}
}
반응형
'알고리즘 > 코드업 기초 100제' 카테고리의 다른 글
[JAVA]코드업 1036번 ~ 1040번 (0) | 2021.04.29 |
---|---|
[JAVA]코드업 1031번 ~ 1035번 (0) | 2021.04.29 |
[JAVA]코드업 1021번 ~ 1025번 (0) | 2021.04.27 |
[JAVA]코드업 1016번 ~ 1020번 (0) | 2021.04.27 |
[JAVA]코드업 1011번 ~ 1015번 (0) | 2021.04.27 |