[코드]class Solution { public int solution(int n) { int answer = 0; for(int i = 2; i [해설] i를 2부터 시작하고 2씩 더해 n까지의 짝수를 모두 출력한 뒤에 answer += i로 출력한 값을 더할 수 있었다. [다른 문제풀이] - if 문 활용class Solution { public int solution(int n) { int answer = 0; for (int i = 1; i [해설]i를 1에서 시작하여 1씩 더하되 if문을 활용하여 만약 i가 2로 나눠서 0인 값이 나온다면, 즉 짝수일 때만 값을 출력하게 만들었다.