반응형
1091번
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.math.BigInteger;
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(" ");
BigInteger aBigInt = new BigInteger(numbers[0]); // 시작값
BigInteger mBigInt = new BigInteger(numbers[1]); // 곱할값
BigInteger dBigInt = new BigInteger(numbers[2]); // 더할값
int n = Integer.parseInt(numbers[3]); // 몇번째 정수
for (int i = 2; i <= n; i++) {
aBigInt = aBigInt.multiply(mBigInt).add(dBigInt);
}
bw.write(aBigInt.toString());
bw.flush();
bw.close();
}
}
1092번
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.math.BigInteger;
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(" ");
int a = Integer.parseInt(numbers[0]);
int b = Integer.parseInt(numbers[1]);
int c = Integer.parseInt(numbers[2]);
int day = 1;
while (true) {
if (day % a == 0 && day % b == 0 && day % c == 0) {
break;
}
day++;
}
bw.write(String.valueOf(day));
bw.flush();
bw.close();
}
}
1093번
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
int callCount = scan.nextInt();
int[] callNumbers = new int[23];
for (int i = 0; i < callCount; i++) {
callNumbers[scan.nextInt() - 1]++;
}
for (int count : callNumbers) {
System.out.print(count + " ");
}
scan.close();
}
}
1094번
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
int callCount = scan.nextInt();
int[] callNumbers = new int[callCount];
for (int i = callCount - 1; i >= 0; i--) {
callNumbers[i] = scan.nextInt();
}
for (int count : callNumbers) {
System.out.print(count + " ");
}
scan.close();
}
}
1095번
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
int callCount = scan.nextInt();
int min = 10000;
for (int i = 0; i < callCount; i++) {
int temp = scan.nextInt();
if (min > temp) {
min = temp;
}
}
System.out.println(min);
scan.close();
}
}
반응형
'알고리즘 > 코드업 기초 100제' 카테고리의 다른 글
[JAVA]코드업 1096번 ~ 1100번 (0) | 2021.05.04 |
---|---|
[JAVA]코드업 1086번 ~ 1090번 (0) | 2021.05.03 |
[JAVA]코드업 1081번 ~ 1085번 (0) | 2021.05.02 |
[JAVA]코드업 1076번 ~ 1080번 (0) | 2021.05.02 |
[JAVA]코드업 1071번 ~ 1075번 (0) | 2021.05.02 |