프로그래머스 181930 주사위 게임 2

1 개요[ | ]

프로그래머스 181930 주사위 게임 2

2 C++[ | ]

#include <string>
#include <vector>
#include <cmath>

using namespace std;

int solution(int a, int b, int c) {
    if( a==b && b==c ) {
        return (a+b+c)*(pow(a,2)+pow(b,2)+pow(c,2))*(pow(a,3)+pow(b,3)+pow(c,3));
    }
    if( a==b || b==c || c==a ) {
        return (a+b+c)*(pow(a,2)+pow(b,2)+pow(c,2));
    }
    return a+b+c;
}
문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}