Problem
Problem URL : 두 정수 사이의 합
[1] Answer Code (18. 07. 22)
#define swap(a,b) a ^= b ^= a ^= b
long long solution(int a, int b) {
if(a>b)
swap(a,b);
long long answer = 0;
for( ; a<=b; a++){
answer += a;
}
return answer;
}
[1] Answer Code (18. 07. 22)
- Programmers Problem