반응형
1066번
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(" ");
for (int i = 0; i < numbers.length; i++) {
if (Integer.parseInt(numbers[i]) % 2 == 0) {
bw.write("even" + "\n");
}else {
bw.write("odd" + "\n");
}
}
bw.flush();
bw.close();
}
}
1067번
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 number = Integer.parseInt(br.readLine());
if (number > 0) {
bw.write("plus\n");
} else {
bw.write("minus\n");
}
if (number % 2 == 0) {
bw.write("even");
} else {
bw.write("odd");
}
bw.flush();
bw.close();
}
}
1068번
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 number = Integer.parseInt(br.readLine());
if (number >= 90) {
bw.write("A");
} else if (number >= 70) {
bw.write("B");
} else if (number >= 40) {
bw.write("C");
} else {
bw.write("D");
}
bw.flush();
bw.close();
}
}
1069번
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));
char ch = (char) br.read();
switch (ch) {
case 'A':
bw.write("best!!!");
break;
case 'B':
bw.write("good!!");
break;
case 'C':
bw.write("run!");
break;
case 'D':
bw.write("slowly~");
break;
default:
bw.write("what?");
break;
}
bw.flush();
bw.close();
}
}
1070번
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());
switch (num) {
case 12:
case 1:
case 2:
bw.write("winter");
break;
case 3:
case 4:
case 5:
bw.write("spring");
break;
case 6:
case 7:
case 8:
bw.write("summer");
break;
case 9:
case 10:
case 11:
bw.write("fall");
break;
}
bw.flush();
bw.close();
}
}
반응형
'알고리즘 > 코드업 기초 100제' 카테고리의 다른 글
[JAVA]코드업 1076번 ~ 1080번 (0) | 2021.05.02 |
---|---|
[JAVA]코드업 1071번 ~ 1075번 (0) | 2021.05.02 |
[JAVA]코드업 1061번 ~ 1065번 (0) | 2021.04.30 |
[JAVA]코드업 1056번 ~ 1060번 (0) | 2021.04.30 |
[JAVA]코드업 1051번 ~ 1055번 (0) | 2021.04.30 |