반응형
# 1088
import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int N = sc.nextInt();
for (int i = 0; i <= N; i++) {
if (i % 3 == 0)
continue;
System.out.print(i + " ");
}
}
}
# 1089
import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int a = sc.nextInt();
int d = sc.nextInt();
int n = sc.nextInt();
int result = a + d * (n - 1);
System.out.println(result);
}
}
# 1090
import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int a = sc.nextInt();
int r = sc.nextInt();
int n = sc.nextInt();
long result = a * (long) Math.pow(r, (n - 1));
System.out.println(result);
}
}
# 1091
import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int a = sc.nextInt();
int m = sc.nextInt();
int d = sc.nextInt();
int n = sc.nextInt();
long result = a * m + d;
if (n == 1) {
System.out.println(a);
} else {
for (int i = 2; i < n; i++) {
result = result * m + d;
}
System.out.println(result);
}
}
}
# 1092
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 day = 1;
while (day % a != 0 || day % b != 0 || day % c != 0) {
day++;
}
System.out.println(day);
}
}
반응형
'개인 공부 > JAVA' 카테고리의 다른 글
[JAVA] Code Up 기초 100제 (1097~ 1099) (0) | 2021.06.28 |
---|---|
[JAVA] Code Up 기초 100제 (1093~ 1096) (0) | 2021.06.27 |
[JAVA] Code Up 기초 100제 (1083 ~ 1087) (0) | 2021.06.25 |
[JAVA] Code Up 기초 100제 (1073 ~ 1082) (0) | 2021.06.24 |
[JAVA] Code Up 기초 100제 (1063 ~ 1072) (0) | 2021.06.23 |