본문 바로가기

백준 문제풀이22

[백준/JAVA] 10817번 세 수 세 정수 A, B, C가 주어진다. 이때, 두 번째로 큰 정수를 출력하는 프로그램을 작성하시오. import java.util.Scanner; public class Main {public static void main(String args[]) {Scanner in = new Scanner(System.in);int input1, input2, input3;int middle = 0;input1 = in.nextInt();input2 = in.nextInt();input3 = in.nextInt(); if ((input1 >= input2 && input2 >= input3) || (input3 >= input2 && input2 >= input1)) {middle = input2;} else if ((input2 >= input1 && input1 >= input3) || (input3 >= i.. 2020. 7. 21.
[백준/JAVA] 5543번 상근날드 import java.util.Scanner; public class Main {public static void main(String args[]) {Scanner in = new Scanner(System.in);int[] input = new int[5];int[] arr = new int[6];int temp,min, result = 0;for (int i = 0; i < 5; i++) {input[i] = in.nextInt();}int k = 0;for (int i = 0; i < 3; i++) {for (int j = 3; j < 5; j++) {arr[k] = input[i] + input[j];k++;}}min = arr[0];for(int i=0;i arr[i]) {min = arr[i.. 2020. 7. 21.
[백준/JAVA] 10039번 평균점수 import java.util.Scanner; public class Main {public static void main(String args[]) {Scanner in = new Scanner(System.in);int[] input = new int[5];int getSum=0,average;for(int i=0;i 2020. 7. 21.
[백준/JAVA] 1110번 더하기 사이클 import java.util.Scanner; public class Main {public static void main(String args[]) {Scanner in = new Scanner(System.in);int N = in.nextInt();int first, second, temp1,result;int count = 0;first = N / 10;second = N % 10;while (true) {count++;temp1 = first + second;result = second * 10 + temp1 % 10;first = second;second = temp1 % 10;if(result == N)break;}System.out.println(count++);}} 더 많은 백준 코드가 .. 2020. 7. 21.