#include <string> #include <vector> using namespace std; int solution(int n) { int answer = 0; for (int i=0; i<=n; i++){ if(i % 2 == 0){ answer += i; } } return answer; }
for 문을 쓸 때 괄호 안에는 , 가 아닌 ; 를 써야한다.