-
Notifications
You must be signed in to change notification settings - Fork 0
Add files via upload #4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<title>1</title> | ||
</head> | ||
<body> | ||
|
||
<script type="text/javascript"> | ||
|
||
var digit1 = Number(prompt('Введите первое число')), | ||
digit2 = Number(prompt('Введите второе число')), | ||
digit3 = Number(prompt('Введите третье число')); | ||
digit4 = Number(prompt('Введите четвертое число')); | ||
|
||
if(digit1 > digit2 && digit1 > digit3 && digit1 > digit4) { | ||
alert(digit1); | ||
} | ||
else if(digit2 > digit1 && digit2 > digit3 && digit1 > digit4) { | ||
alert(digit2); | ||
} | ||
else if (digit3 > digit1 && digit3 > digit2 && digit3 > digit4) { | ||
alert(digit3); | ||
} | ||
else if (digit4 > digit1 && digit4 > digit2 && digit4 > digit3) { | ||
alert(digit4); | ||
} | ||
|
||
summ = Math.pow(digit1, -1) + Math.pow(digit2, -1) + Math.pow(digit3, -1) + Math.pow(digit4, -1); | ||
|
||
summ2 = summ / 4; | ||
|
||
summ3 = Math.pow(summ2, -1); | ||
|
||
alert('среднее гармоническое этих четырёх чисел =' + summ3); | ||
|
||
|
||
|
||
</script> | ||
|
||
</body> | ||
</html> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<title>2</title> | ||
</head> | ||
<body> | ||
|
||
<script type="text/javascript"> | ||
|
||
var digit1 = Number(prompt('Введите первое число')), | ||
digit2 = Number(prompt('Введите второе число')), | ||
digit3 = Number(prompt('Введите третье число')); | ||
|
||
summ = digit1 + digit2; | ||
summ2 = digit1 + digit3; | ||
summ3 = digit2 + digit3; | ||
|
||
if(digit1 < summ && digit1 < summ2 && digit1 < summ3 && digit2 < summ && digit2 < summ2 && digit2 < summ3 && digit3 < summ && digit3 < summ2 && digit3 < summ3) { | ||
alert("Вы ввели числа привильно"); | ||
} | ||
else{ | ||
alert("вводите первые от наибольшего к наименьшему ; пример: 7, 4, 3тье число должно быть меньше 7+4 и меньше 7"); | ||
} | ||
|
||
|
||
</script> | ||
|
||
</body> | ||
</html> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<title>3</title> | ||
</head> | ||
<body> | ||
|
||
<script type="text/javascript"> | ||
|
||
var digit1 = Number(prompt('Введите первое число')), | ||
digit2 = Number(prompt('Введите второе число')); | ||
|
||
if( digit1 % digit2 == 0) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Используйте строгое сравнение |
||
alert("Остатка нет"); | ||
} | ||
else{ | ||
alert("Остаток есть"); | ||
} | ||
|
||
</script> | ||
|
||
</body> | ||
</html> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<title>4</title> | ||
</head> | ||
<body> | ||
|
||
<script type="text/javascript"> | ||
|
||
var digit1 = Number(prompt('Введите число 1099511627776')); | ||
|
||
d1 = digit1 / 1024; | ||
|
||
d2 = digit1 / 1048576; | ||
|
||
d3 = digit1 / 1073741824; | ||
|
||
alert(digit1 + "Байт"); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Нужно было вывести только одну единицу - самую подходяющую для значения |
||
alert(d1 + "Килобайт"); | ||
alert(d2 + "Мегабайт"); | ||
alert(d3 + "Гигагабайт"); | ||
|
||
</script> | ||
|
||
</body> | ||
</html> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<title>5</title> | ||
</head> | ||
<body> | ||
|
||
<script type="text/javascript"> | ||
|
||
var a = Number(prompt('Введите число 1')); | ||
var b = Number(prompt('Введите число 2')); | ||
var c = Number(prompt('Введите число 3')); | ||
|
||
p = 1/2 * (a + b + c); | ||
|
||
s = p * (p - a) * (p - b) * (p - c); | ||
|
||
s2 = Math.sqrt(s) | ||
|
||
alert("Площать теугольника" + s2); | ||
|
||
</script> | ||
|
||
</body> | ||
</html> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<title>6</title> | ||
</head> | ||
<body> | ||
|
||
<script type="text/javascript"> | ||
|
||
var year = Number(prompt('Введите год')); | ||
|
||
if(year % 4 == 0 && year % 100 != 0 || year % 400 == 0){ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Используйте строгие сравнения и отрицания |
||
alert("Год високосный"); | ||
} | ||
else | ||
alert("Год не високосный"); | ||
</script> | ||
|
||
</body> | ||
</html> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Избыточное условие. Нужно проверить, чтобы сумма двух сторон была не меньше третьей, а не каждой из трех