티스토리 뷰

Coding

Node.js - 구구단

out of coding 2020. 9. 3. 19:12
function print_all() {
    for (var dan = 2; dan <= 9; dan++) {
        print_dan(dan);
    }
}

function print_dan(dan) {
    console.log(dan, "단");
    for (var index = 1; index <= 9; index++) {
        console.log(dan, "*", index, "=", dan * index);
    }
}

print_all();
print_dan(2);

간단하게 구현

'Coding' 카테고리의 다른 글

Algorithm. permutation 순회  (0) 2020.12.28
Dynamic Programming  (0) 2020.12.19
Ruby. Gugudan  (0) 2020.08.30
Python3. 구구단  (0) 2020.08.30
Python3. Interest Compute  (0) 2020.08.29
댓글
공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
«   2025/02   »
1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28
글 보관함