Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Богдан Пархоменко
- //https://zero.p2p.shpp.me/tasks/3_5_christmas_tree.html
- let tree = +prompt("розмір ялинки: ");
- for (let space = tree - 1, star = 1; tree > 0; space-- , tree-- , star += 2) {
- for (let Auxiliary_variable1 = space; Auxiliary_variable1 > 0; Auxiliary_variable1--){
- console.put(" ");
- }
- for (let Auxiliary_variable2 = star; Auxiliary_variable2 > 0; Auxiliary_variable2--){
- console.put("*");
- }
- if (tree == 1) {
- console.log();
- while (star - 1 > 0) {
- console.put(" ");
- star -= 2;
- }
- console.put("*");
- }
- console.log();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement