목록algorithm (26)
남극
class Test { long sum(int[] a) { int sum = 0; for (int i = 0; i < a.length; i++) { sum += a[i]; } return sum; } }
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class Baekjoon8958 { public static void main(String[] args) throws IOException { BufferedReader bf = new BufferedReader(new InputStreamReader(System.in)); String s = bf.readLine(); int result = 0; int cnt = 0; String[] arr = {}; int n = Integer.parseInt(s); String[] l = new String[n+1]; for (int i..
import java.util.Scanner; public class Test { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int N = sc.nextInt(); double[] arr = new double[N]; double max = -987654321, M = 0; for (int i = 0; i < N; i++) { arr[i] = sc.nextInt(); if (max < arr[i]) { max = arr[i]; } } for (int i = 0; i < N; i++) { M += arr[i] / max * 100.0; } System.out.println(M / N); } }
import java.io.BufferedReader; import java.io.BufferedWriter; import java.io.InputStreamReader; import java.io.OutputStreamWriter; public class Baekjoon3052{ public static void main(String[] args) throws Exception { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out)); boolean[] arr= new boolean[42]; ..
import java.util.Scanner; public class Baekjoon11111 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int a = sc.nextInt(); int b = sc.nextInt(); int c = sc.nextInt(); sc.close(); int[] cnt = new int[10]; int num = a*b*c; while(num > 0) { cnt[num % 10]++; num /= 10; } for (int i = 0; i < cnt.length; i++) { System.out.println(cnt[i]); } } }
간단한 알고리즘입니다. public class Baekjoon2562 { public static void main(String[] args) throws IOException { Scanner sc = new Scanner(System.in); int max = -87654321; int index = 0; int[] list = new int[9]; for (int i = 0; i < 9; i++) { list[i] = sc.nextInt(); if (max < list[i]) { max = list[i]; index = i; } } System.out.println(max); System.out.println(index + 1); } }