diff --git a/pz_1.9/pz_1_9_01.js b/pz_1.9/pz_1_9_01.js new file mode 100644 index 0000000..0f3657a --- /dev/null +++ b/pz_1.9/pz_1_9_01.js @@ -0,0 +1,13 @@ +let n = 100; +let i = 2; +while ( i <= n) { + let flag=1; + let j = 2; + while ((j <= i/2)&&(flag==1)) { + j=j+1; + if (i%j==0) { + flag=0} + } + if(flag==1) {console.log(i);} + i++; +} \ No newline at end of file diff --git a/pz_1.9/pz_1_9_02.js b/pz_1.9/pz_1_9_02.js new file mode 100644 index 0000000..3726f4c --- /dev/null +++ b/pz_1.9/pz_1_9_02.js @@ -0,0 +1,18 @@ +let max= 20; +let zero = " - це нуль" +let even = " - парне число" +let no_even = " - не парне число" + +let i = 0; +do { + let number = i++; + + if (number == 0) { + console.log(number, zero); + } else if (number % 2 == 0) { + console.log(number, even); + } else { + console.log(number, no_even); + } + +} while (i <= max) \ No newline at end of file diff --git a/pz_1.9/pz_1_9_03.js b/pz_1.9/pz_1_9_03.js new file mode 100644 index 0000000..94dda62 --- /dev/null +++ b/pz_1.9/pz_1_9_03.js @@ -0,0 +1,3 @@ +let numb = ' '; +for( let i=0; i<=9; numb += i+' ', i++){/*тут пусто*/} +console.log(numb); \ No newline at end of file diff --git a/pz_1.9/pz_1_9_04.js b/pz_1.9/pz_1_9_04.js new file mode 100644 index 0000000..c574693 --- /dev/null +++ b/pz_1.9/pz_1_9_04.js @@ -0,0 +1,23 @@ +let tru ="*" + let pra= "*" + let rom="*" + let l=" " + let k=" " + let der=6; + + for(let i = 0;i<5;i++){ + console.log(tru+l+pra+k+rom) + + tru+="*"; + pra+="**" + l = l.substring(0,l.length-2) + + if(i<2){ + k = k.substring(0,k.length-2) + rom+="**" + + } + else{ + rom = rom.substring(0,rom.length-2) + } + } \ No newline at end of file diff --git a/pz_1.9/pz_1_9_05.js b/pz_1.9/pz_1_9_05.js new file mode 100644 index 0000000..b313673 --- /dev/null +++ b/pz_1.9/pz_1_9_05.js @@ -0,0 +1,10 @@ +let numb =10000; +let counter = 0; +let result; +do{ + numb=numb/2; + counter++; +}while (numb>50){ +result = numb ; +} +console.log(result,counter); diff --git a/pz_1.9/pz_1_9_06.html b/pz_1.9/pz_1_9_06.html new file mode 100644 index 0000000..76f33ee --- /dev/null +++ b/pz_1.9/pz_1_9_06.html @@ -0,0 +1,41 @@ + + + + + + + pz_1.9 + + + + + \ No newline at end of file diff --git a/pz_1.9/pz_1_9_07.html b/pz_1.9/pz_1_9_07.html new file mode 100644 index 0000000..dde0f7d --- /dev/null +++ b/pz_1.9/pz_1_9_07.html @@ -0,0 +1,16 @@ + + + + + + + pz_1.9 + + + + + \ No newline at end of file diff --git a/pz_1.9/pz_1_9_08.html b/pz_1.9/pz_1_9_08.html new file mode 100644 index 0000000..a50b839 --- /dev/null +++ b/pz_1.9/pz_1_9_08.html @@ -0,0 +1,35 @@ + + + + + + + Document + + + + + \ No newline at end of file