public class Solution {
public static String repeatStr(final int repeat, final String string) {
String result = "";
if (repeat > 0) {
for (int i = 0; i < repeat; i++) {
result += string;
}
}
return result;
}
}
'문제 풀이 > 자바' 카테고리의 다른 글
자바 문제 풀이 18 (0) | 2023.04.30 |
---|---|
자바 문제 풀이 17 (0) | 2023.04.30 |
자바 문제 풀이 15 (0) | 2023.04.25 |
자바 문제 풀이 14 (0) | 2023.04.24 |
자바 문제 풀이 13 (0) | 2023.04.24 |