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; } }
ALGORITHM ๐ค
์๊ณ ๋ฆฌ์ฆ ์ฐ์ต / ์ฝ๋ฉํ ์คํธ ์ค๋น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; } }