From 7f67cd98ca73a677777d05ad7f13e5aa22498db7 Mon Sep 17 00:00:00 2001 From: "DESKTOP-P9VU163\\admin" Date: Thu, 26 Jun 2025 20:39:31 +0300 Subject: [PATCH] add new value for chisloP --- src/index.ts | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/src/index.ts b/src/index.ts index fb96a1f..0c3ffc1 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,9 +1,12 @@ -function DrawLine(count: number){ - const minimalString = '*'; - console.log(minimalString.repeat(count)); +function DrawLine(count: number, countP: number){ + const minimalString = '*'; + const minimalP = ' '; + + console.log(minimalP.repeat(countP)+minimalString.repeat(count)); } -let chisloN: number = 10; +let chisloN: number = 3; + //i++ => i = i + 1 //i-- => i = i - 1 @@ -13,8 +16,6 @@ let chisloN: number = 10; // str = str + '*' // i = 0 => str = '*' // i == 1 => '**' // i = 2 => '***' // } -for(let index = 1; index <= chisloN; index++){ - DrawLine(index); +for(let index = 1; index <= chisloN * 2; index = index + 2){ + DrawLine(index, chisloN * 2 -index); } - -