반응형
# 1083
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 = 1; i <= n; i++) {
if (i % 3 == 0 || i % 6 == 0) {
System.out.print("X");
System.out.print(" ");
} else {
System.out.print(i);
System.out.print(" ");
}
}
}
}
# 1084
import java.io.*;
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[] rgb = br.readLine().split(" ");
int r = Integer.parseInt(rgb[0]);
int g = Integer.parseInt(rgb[1]);
int b = Integer.parseInt(rgb[2]);
int cnt = r * g * b;
for (int i = 0; i < r; i++) {
for (int j = 0; j < g; j++) {
for (int k = 0; k < b; k++) {
bw.write(i + " " + j + " " + k + "\n");
}
}
}
bw.write(String.valueOf(cnt));
bw.flush();
bw.close();
br.close();
}
}
# 1085
import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
long h = sc.nextLong();
long b = sc.nextLong();
long c = sc.nextLong();
long s = sc.nextLong();
double total = h * b * c * s;
double result = ((total / 8) / Math.pow(2, 10) / Math.pow(2, 10));
System.out.printf("%.1f MB", result);
}
}
# 1086
import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
long r = sc.nextLong();
long g = sc.nextLong();
long b = sc.nextLong();
double result = (r * g * b / 8 /Math.pow(2, 10) / Math.pow(2, 10));
System.out.printf("%.2f MB", result);
}
}
# 1087
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
long a = sc.nextLong();
long sum = 0;
for (int i = 1; i < 10000000; i++) {
sum += i;
if (sum >= a) {
System.out.println(sum);
break;
}
}
}
}
반응형
'개인 공부 > JAVA' 카테고리의 다른 글
[JAVA] Code Up 기초 100제 (1093~ 1096) (0) | 2021.06.27 |
---|---|
[JAVA] Code Up 기초 100제 (1088 ~ 1092) (0) | 2021.06.26 |
[JAVA] Code Up 기초 100제 (1073 ~ 1082) (0) | 2021.06.24 |
[JAVA] Code Up 기초 100제 (1063 ~ 1072) (0) | 2021.06.23 |
[JAVA] Code Up 기초 100제 (1053 ~ 1062) (0) | 2021.06.22 |