Skip to content

Latest commit

 

History

History
23 lines (17 loc) · 521 Bytes

File metadata and controls

23 lines (17 loc) · 521 Bytes

프로그래머스 Level1 : 연습문제 수박수박수박수박수박수?

class Solution {
    public String solution(int n) {
        String answer = "";
        StringBuilder sb = new StringBuilder();
        
        for(int i=0; i<n/2; i++){
            sb.append("수박");   
        }
        
        if(n%2 != 0)
            sb.append("수");  
        
        
        answer = sb.toString();
        return answer;
    }
}