반응형
# 1063
import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int a = sc.nextInt();
int b = sc.nextInt();
int result = (a > b) ? a : b;
System.out.println(result);
}
}
# 1064
import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int a = sc.nextInt();
int b = sc.nextInt();
int c = sc.nextInt();
int result = (a > b ? b : a) > c ? c : (a > b ? b : a);
System.out.println(result);
}
}
# 1065
import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int a = sc.nextInt();
int b = sc.nextInt();
int c = sc.nextInt();
if (a % 2 == 0) {
System.out.println(a);
}
if (b % 2 == 0) {
System.out.println(b);
}
if (c % 2 == 0) {
System.out.println(c);
}
}
}
# 1066
import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int a = sc.nextInt();
int b = sc.nextInt();
int c = sc.nextInt();
if (a % 2 == 0) {
System.out.println("even");
} else {
System.out.println("odd");
}
if (b % 2 == 0) {
System.out.println("even");
} else {
System.out.println("odd");
}
if (c % 2 == 0) {
System.out.println("even");
} else {
System.out.println("odd");
}
}
}
# 1067
import java.util.*;
public class Main {
public static void oddEven(int x) {
if (x % 2 == 0) {
System.out.println("even");
} else {
System.out.println("odd");
}
}
public static void minusPlus(int x) {
if (x > 0) {
System.out.println("plus");
} else {
System.out.println("minus");
}
}
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int a = sc.nextInt();
minusPlus(a);
oddEven(a);
}
}
# 1068
import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int score = sc.nextInt();
if (score >= 90 && score <=100) {
System.out.println("A");
} else if (score >= 70 && score < 90) {
System.out.println("B");
} else if (score >= 40 && score < 70) {
System.out.println("C");
} else {
System.out.println("D");
}
}
}
# 1069
import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
char score = sc.nextLine().charAt(0);
switch (score) {
case 'A':
System.out.println("best!!!");
break;
case 'B':
System.out.println("good!!");
break;
case 'C':
System.out.println("run!");
break;
case 'D':
System.out.println("slowly~");
break;
default:
System.out.println("what?");
break;
}
}
}
# 1070
import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int month = sc.nextInt();
switch (month) {
case 12:
case 1:
case 2:
System.out.println("winter");
break;
case 3:
case 4:
case 5:
System.out.println("spring");
break;
case 6:
case 7:
case 8:
System.out.println("summer");
break;
case 9:
case 10:
case 11:
System.out.println("fall");
break;
}
}
}
# 1071
import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
while (true) {
int n = sc.nextInt();
if (n == 0)
break;
System.out.println(n);
}
}
}
# 1072
import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
int array[] = new int[n];
for (int i = 0; i < n; i++) {
array[i] = sc.nextInt();
System.out.println(array[i]);
}
}
}
반응형
'개인 공부 > JAVA' 카테고리의 다른 글
[JAVA] Code Up 기초 100제 (1083 ~ 1087) (0) | 2021.06.25 |
---|---|
[JAVA] Code Up 기초 100제 (1073 ~ 1082) (0) | 2021.06.24 |
[JAVA] Code Up 기초 100제 (1053 ~ 1062) (0) | 2021.06.22 |
[JAVA] Code Up 기초 100제 (1043 ~ 1052) (0) | 2021.06.21 |
[JAVA] Code Up 기초 100제 (1033 ~ 1042) (0) | 2021.06.20 |