프로그래머스 181938 두 수의 연산값 비교하기

1 개요[ | ]

프로그래머스 181938 두 수의 연산값 비교하기

2 C++[ | ]

#include <string>
#include <vector>

using namespace std;

int concat(int a, int b) {
    int temp = b;
    while(temp) {
        a *= 10;        
        temp /= 10;
    }
    return a + b;
}

int solution(int a, int b) {
    return max(concat(a,b), 2*a*b);
}
문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}