This repository was archived by the owner on May 7, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathq3_maior_3_numeros.html
More file actions
89 lines (88 loc) · 2.85 KB
/
q3_maior_3_numeros.html
File metadata and controls
89 lines (88 loc) · 2.85 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
<!DOCTYPE html>
<html lang="pt">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Identificar o maior entre três números</title>
<style>
body {
background: #888871;
font: normal 20pt times;
}
header {
color: rgb(15, 15, 15);
text-align: center;
}
div.entrada {
background: #59c4ee;
border-radius: 13px;
padding: 15px;
width: auto;
margin: auto;
text-align: center;
box-shadow: 5px 5px 10px rgba(0, 0, 0, 0.384);
}
div.saída {
background: #ececea;
border-radius: 13px;
padding: 15px;
width: auto;
margin: auto;
text-align: center;
box-shadow: 5px 5px 10px rgba(0, 0, 0, 0.384);
}
footer {
color: black;
text-align: center;
font-style: oblique;
}
</style>
</head>
<body>
<header><h1>
Verificar qual dos três números é o maior.
</h1></header>
<section>
<div class="entrada">
<p >
Indique um valor: <input style="font: normal 20pt times; width: 50px; height: 30px;" type="number" id="txtnum1">
</p>
<p>
Indique outro valor: <input style="font: normal 20pt times; width: 50px; height: 30px;" type="number" id="txtnum2">
</p>
<p>
Indique mais um valor: <input style="font: normal 20pt times; width: 50px; height: 30px;" type="number" id="txtnum3">
</p>
<p style="text-align: center;">
<input style="font: normal 20pt times;" type="button" value="Análise!" onclick="analisar()">
</p>
</div>
<div class="saída" id="saida">
</div>
</section>
<section>
<footer>
<p>© BrunoCastro </p>
</footer>
</section>
</body>
<script>
function analisar() {
const entrada1 = window.document.querySelector('input#txtnum1')
const entrada2 = window.document.querySelector('input#txtnum2')
const entrada3 = window.document.querySelector('input#txtnum3')
const num1 = Number(entrada1.value)
const num2 = Number(entrada2.value)
const num3 = Number(entrada3.value)
const saida = window.document.querySelector('div#saida')
if (num1 > num2 && num1 > num3) {
saida.innerHTML = `<p> O maior valor digitado foi <strong>${num1}</strong>.<p>`
} else if (num2 > num1 && num2 > num3) {
saida.innerHTML = `<p> O maior valor digitado foi <strong>${num2}</strong>.<p>`
} else {
saida.innerHTML = `<p> O maior valor digitado foi <strong>${num3}</strong>.<p>`
}
}
</script>
</html>