단위반복

2026년 2월 4일 12:52분

package com.jesusbornd.exodus;

public class Exodus_26_Chapter_Lv2 {

    static String repeat(String unit, int count) {
        return unit.repeat(Math.max(0, count));
    }

    public static void main(String[] args) {
        String curtainUnit = "휘장 / Curtain|";
        String frameUnit = "널판 / Frame|";

        String curtains = repeat(curtainUnit, 5);
        String frames = repeat(frameUnit, 3);

        System.out.println(curtains);
        System.out.println(frames);
    }
}

def repeat(unit: str, count: int) -> str:
    return unit * max(0, count)

curtain_unit = "휘장 / Curtain|"
frame_unit = "널판 / Frame|"

curtains = repeat(curtain_unit, 5)
frames = repeat(frame_unit, 3)

print(curtains)
print(frames)

Comments

Avatar
 2026년 2월 4일 12:54분

하루의 순종이 한 장의 휘장이라면, 꾸준함이 성막 전체를 완성한다.



Search

← 목록으로