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; } }
https://school.programmers.co.kr/learn/courses/30/lessons/12928 class Solution { public int solution(int n) { int answer = 0; for(int i = 1; i
https://school.programmers.co.kr/learn/courses/30/lessons/120910 class Solution { public int solution(int n, int t) { int answer = n; for (int i = 1; i
https://school.programmers.co.kr/learn/courses/30/lessons/120903 class Solution { public int solution(String[] s1, String[] s2) { int answer = 0; for(int i = 0; i < s2.length; i++){ for(int j = 0; j < s1.length; j++){ if(s2[i].equals(s1[j])){ // 문자열이 같은지 비교할 때는 .equals() 를 사용 answer++; } } } return answer; } }
https://school.programmers.co.kr/learn/courses/30/lessons/120909 class Solution { public int solution(int n) { int answer = 0; for(int i = 1; i