[프로그래머스]더 크게 합치기

개-발뚜-발·2023년 7월 27일
0

코딩테스트 연습

목록 보기
6/6

답안


class Solution {
    public int solution(int a, int b) {
        int answer = 0;
        
        String Plus1 = String.valueOf(a) +  String.valueOf(b);
        String Plus2 =  String.valueOf(b) +  String.valueOf(a);
        
        int ab = Integer.parseInt(Plus1);
        int ba = Integer.parseInt(Plus2);
        
        if(ab < ba){
            return answer += ba;
        }else{
            return answer += ab;
        }


profile
관심O 댓글O 감놔라배놔라O 가르쳐주는거O 한가할때올립니다

0개의 댓글