ALGORITHM ๐Ÿค–

์•Œ๊ณ ๋ฆฌ์ฆ˜ ์—ฐ์Šต / ์ฝ”๋”ฉํ…Œ์ŠคํŠธ ์ค€๋น„
https://school.programmers.co.kr/learn/courses/30/lessons/120851 class Solution { public int solution(String my_string) { int answer = 0; String [] arr = my_string.replaceAll("[a-zA-Z]","").split(""); for (String s : arr) { if (!s.equals("")) { answer += Integer.parseInt(s); } } return answer; } }
https://school.programmers.co.kr/learn/courses/30/lessons/12954 class Solution { public long[] solution(long x, int n) { long[] answer = new long[n]; for(int i = 0; i < n; i++){ answer[i] = x + x * i; } return answer; } }
https://www.acmicpc.net/problem/25083 25083๋ฒˆ: ์ƒˆ์‹น ์•„๋ž˜ ์˜ˆ์ œ์™€ ๊ฐ™์ด ์ƒˆ์‹น์„ ์ถœ๋ ฅํ•˜์‹œ์˜ค. www.acmicpc.net public class Main { public static void main(String[] args) { System.out.println(" ,r'\"7"); System.out.println("r`-_ ,' ,/"); System.out.println(" \\. \". L_r'"); System.out.println(" `~\\/"); System.out.println(" |"); System.out.println(" |"); } }
https://www.acmicpc.net/problem/11022 11022๋ฒˆ: A+B - 8 ๊ฐ ํ…Œ์ŠคํŠธ ์ผ€์ด์Šค๋งˆ๋‹ค "Case #x: A + B = C" ํ˜•์‹์œผ๋กœ ์ถœ๋ ฅํ•œ๋‹ค. x๋Š” ํ…Œ์ŠคํŠธ ์ผ€์ด์Šค ๋ฒˆํ˜ธ์ด๊ณ  1๋ถ€ํ„ฐ ์‹œ์ž‘ํ•˜๋ฉฐ, C๋Š” A+B์ด๋‹ค. www.acmicpc.net import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int t = sc.nextInt(); for(int i = 1; i
https://www.acmicpc.net/problem/15552 15552๋ฒˆ: ๋น ๋ฅธ A+B ์ฒซ ์ค„์— ํ…Œ์ŠคํŠธ์ผ€์ด์Šค์˜ ๊ฐœ์ˆ˜ T๊ฐ€ ์ฃผ์–ด์ง„๋‹ค. T๋Š” ์ตœ๋Œ€ 1,000,000์ด๋‹ค. ๋‹ค์Œ T์ค„์—๋Š” ๊ฐ๊ฐ ๋‘ ์ •์ˆ˜ A์™€ B๊ฐ€ ์ฃผ์–ด์ง„๋‹ค. A์™€ B๋Š” 1 ์ด์ƒ, 1,000 ์ดํ•˜์ด๋‹ค. www.acmicpc.net 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 Buf..
https://school.programmers.co.kr/learn/courses/30/lessons/12937 class Solution { public String solution(int num) { String answer = ""; if(num % 2 != 0){ answer = "Odd"; } else{ answer = "Even"; } return answer; } }
https://school.programmers.co.kr/learn/courses/30/lessons/12944 class Solution { public double solution(int[] arr) { double answer = 0; for (int j : arr) { answer += j; } return answer / arr.length; } }
daxx0ne
'ALGORITHM ๐Ÿค–' ์นดํ…Œ๊ณ ๋ฆฌ์˜ ๊ธ€ ๋ชฉ๋ก (11 Page)