반응형
1011번
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));
char ch = br.readLine().charAt(0);
System.out.println(ch);
}
}
1012번
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));
float f = Float.parseFloat(br.readLine());
String s = String.format("%.6f", f);
System.out.print(s);
}
}
1013번
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.print(numbers[0] + " " + numbers[1]);
}
}
1014번
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.print(numbers[1] + " " + numbers[0]);
}
}
1015번
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));
float f = Float.parseFloat(br.readLine());
String s = String.format("%.2f", f);
System.out.print(s);
}
}
반응형
'알고리즘 > 코드업 기초 100제' 카테고리의 다른 글
[JAVA]코드업 1026번 ~ 1030번 (0) | 2021.04.29 |
---|---|
[JAVA]코드업 1021번 ~ 1025번 (0) | 2021.04.27 |
[JAVA]코드업 1016번 ~ 1020번 (0) | 2021.04.27 |
[JAVA]코드업 1006번 ~ 1010번 (0) | 2021.04.27 |
[JAVA]코드업 1001번 ~ 1005번 (0) | 2021.04.27 |