반응형
1036번
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));
int ascii = br.readLine().charAt(0);
System.out.println(ascii);
}
}
1037번
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));
int ascii = Integer.parseInt(br.readLine());
System.out.println((char)ascii);
}
}
1038번 ~ 1039번
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
public class Main {
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out));
String[] numbers = br.readLine().split(" ");
long num1 = Long.parseLong(numbers[0]);
long num2 = Long.parseLong(numbers[1]);
bw.write(String.valueOf(num1 + num2));
bw.flush();
bw.close();
}
}
1040번
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
public class Main {
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out));
int num = Integer.parseInt(br.readLine());
bw.write(String.valueOf(-num));
bw.flush();
bw.close();
}
}
반응형
'알고리즘 > 코드업 기초 100제' 카테고리의 다른 글
[JAVA]코드업 1046번 ~ 1050번 (0) | 2021.04.30 |
---|---|
[JAVA]코드업 1041번 ~ 1045번 (0) | 2021.04.30 |
[JAVA]코드업 1031번 ~ 1035번 (0) | 2021.04.29 |
[JAVA]코드업 1026번 ~ 1030번 (0) | 2021.04.29 |
[JAVA]코드업 1021번 ~ 1025번 (0) | 2021.04.27 |