hi2all'git config --blobal user.email genanatarov@gmail.com@ 4 år sedan
förälder
incheckning
980f6fe2c7
2 ändrade filer med 89 tillägg och 1 borttagningar
  1. 1 1
      js/02/index.html
  2. 88 0
      js/02/js/main.js

+ 1 - 1
js/02/index.html

@@ -6,6 +6,6 @@
     <title>Document</title>
 </head>
 <body>
-    
+    <script src="js/main.js"></script>
 </body>
 </html>

+ 88 - 0
js/02/js/main.js

@@ -0,0 +1,88 @@
+//                  Год рождения                //
+
+//let years = prompt('How old are you ?')
+//alert('You were born in ' + (2020 - years))
+
+// =============================================//
+//                  Температура                 //
+
+//let degree = prompt('what is your temperature ?')
+//alert('Your temperature is ' + (degree * (9/5) + 32) + ' Fahrenheit');
+
+//==============================================//
+//                  Number: divide              //
+
+//let firstNumber = prompt('Write some number');
+//let secondNumber = prompt('Write some number');
+//alert(Math.floor(firstNumber/secondNumber));
+
+//==============================================//
+//                  Number: odd                 //
+
+// let number = prompt('Write a number');
+// if(+number) {
+//    alert('good job');
+// } else {
+//    alert('Print an even number or not even');
+//    number;
+// }
+
+//==============================================//               
+//                  String: greeting            //
+
+// let name = prompt('What is your name ?');
+// alert('Hello ' + name);
+
+//==============================================//
+//                  String: lexics              //
+
+// let text = prompt('Write some text here');
+// if(text.includes('fuck')) {
+//     alert("Don't use curse words, you fucking asshole");
+// } else {
+//     alert("It's fine, bro");
+// }
+
+//==============================================//
+//                  confirm                     //
+
+// let idiot = confirm('Are you idiot ?')
+// alert(idiot);
+
+//==============================================//
+//                  Boolean                     //
+
+// let children = confirm('Do you have children ?')
+// let childrenNumber = children;
+
+//==============================================//
+//                  Boolean: if                 //
+
+// let penis = confirm('Do you have a penis ?')
+// if(penis == true) {
+//     alert('Congratulations, you are the man ! ! ! ! !')
+// } else {
+//     alert('Feel sorry for you, you are the girl')
+// }
+
+//==============================================//
+//                  Array: real                 //
+
+
+
+
+
+
+//                  СНИНИЙ ПОЯС                 //
+
+let apps = 144;
+let entry = 4;
+let floor = 9;
+let k = prompt('Введи номер квартиры')
+let a = apps / (entry * floor); // квартир на этаже
+let ab = apps / entry; // в одном подъезде квартир
+let cb = Math.trunc(1 + (k - 1) / ab); // Номер подъезда
+let cd = Math.trunc(1 + ((k - 1) % ab) / a); // Номер этажа
+alert('Подъезд: ' + cb + ' Этаж; ' + cd);
+
+//==============================================//