Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions Sohee-An/src/baekjoon/BOJ_10817.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;

public class Main {
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
String[] input = br.readLine().split(" ");
int a = Integer.parseInt(input[0]);
int b = Integer.parseInt(input[1]);
int c = Integer.parseInt(input[2]);
br.close();

int arr[] = {a, b, c};
Arrays.sort(arr);
System.out.println(arr[1]);
}
}
20 changes: 20 additions & 0 deletions Sohee-An/src/baekjoon/BOJ_15552.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import java.io.*;
import java.util.StringTokenizer;

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 n = Integer.parseInt(br.readLine());
StringTokenizer st;

for(int i=0; i<n; i++) {
st = new StringTokenizer(br.readLine(), " ");
bw.write((Integer.parseInt(st.nextToken())) + (Integer.parseInt(st.nextToken())) + "\n");
}
br.close();
bw.flush();
bw.close();
}
}
16 changes: 16 additions & 0 deletions Sohee-An/src/baekjoon/BOJ_2010.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import java.util.Scanner;

public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int mulTab = sc.nextInt();
int plug = 1;

for(int i=0; i < mulTab; i++) {
plug += sc.nextInt();
}
plug -= mulTab;
System.out.println(plug);
sc.close();
}
}
11 changes: 11 additions & 0 deletions Sohee-An/src/baekjoon/BOJ_2163.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import java.util.Scanner;

public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
int m = sc.nextInt();
int result = (n * m)-1;
System.out.println(result);
}
}
19 changes: 19 additions & 0 deletions Sohee-An/src/baekjoon/BOJ_2501.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import java.util.Scanner;

public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
int k = sc.nextInt();
sc.close();

for(int i=1; i <= n; i++){
if(n % i == 0){ k--; }
if(k == 0){
System.out.println(i);
break;
}
}
if(k != 0){ System.out.println(0); }
}
}
22 changes: 22 additions & 0 deletions Sohee-An/src/baekjoon/BOJ_2525.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import java.util.Scanner;

public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int hour = sc.nextInt();
int minute = sc.nextInt();
int time = sc.nextInt();
sc.close();

minute += time;
while(minute >= 60){
hour++;
minute -= 60;

if(hour >= 24){
hour = 0;
}
}
System.out.println(hour + " " + minute);
}
}
22 changes: 22 additions & 0 deletions Sohee-An/src/baekjoon/BOJ_2562.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
int max = 0, index = 0;

for(int i=0; i < 9; i++){
int input = Integer.parseInt(br.readLine());

if(max < input){
max = input;
index = i+1;
}
}
br.close();
System.out.println(max);
System.out.println(index);
}
}
20 changes: 20 additions & 0 deletions Sohee-An/src/baekjoon/BOJ_5086.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import java.util.Scanner;

public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
while(true){
int a = sc.nextInt();
int b = sc.nextInt();
if(a == 0 & b == 0) break;
if(a % b == a){
System.out.println("factor");
} else if(a % b == 0){
System.out.println("multiple");
} else {
System.out.println("neither");
}
}
sc.close();
}
}
28 changes: 28 additions & 0 deletions Sohee-An/src/baekjoon/BOJ_8958.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import java.io.*;

public class Main {
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
int tCase = Integer.parseInt(br.readLine());
String ox[] = new String[tCase];

for(int i=0; i < tCase; i++){
ox[i] = br.readLine();
}
br.close();

for(int i=0; i<ox.length; i++) {
int cnt = 0;
int sum = 0;
for(int j=0; j<ox[i].length(); j++){
if(ox[i].charAt(j) == 'O'){
cnt++;
} else {
cnt = 0;
}
sum += cnt;
}
System.out.print(sum + "\n");
}
}
}