-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmath.html
68 lines (63 loc) · 1.74 KB
/
math.html
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
<html>
<head>
<style>
p {
color: black;
font-size: 16px;
}
#question {
color: black;
font-size: 36px;
background-color: #00000000;
border-style: dashed;
border-color: #000000ff;
border-width: 1px;
}
</style>
<link rel="shortcut icon" href="/images/Lyif233.ico">
</head>
<body>
<title>速算达人!</title>
<h1>资源码转换</h1>
<p id="question"></p>
<p><button type="button" onclick="question()">出题</button></p>
<p><button type="button" onclick="less()"><</button> <button type="button" onclick="yes()">=</button> <button type="button"
onclick="more()">></button></p>
<p id="output"></p>
</body>
<script>
var a
var b
var c
function question() {
a = Math.floor((Math.random() * 10) + 1);
b = Math.floor((Math.random() * 10) + 1);
c = Math.floor((Math.random() * 20) + 1);
document.getElementById("question").innerHTML = a + "+" + b + " " + c
}
function less() {
if (a + b < c) {
document.getElementById("output").innerHTML = "Right"
}
else {
document.getElementById("output").innerHTML = "Wrong"
}
}
function yes() {
if (a + b == c) {
document.getElementById("output").innerHTML = "Right"
}
else {
document.getElementById("output").innerHTML = "Wrong"
}
}
function more() {
if (a + b > c) {
document.getElementById("output").innerHTML = "Right"
}
else {
document.getElementById("output").innerHTML = "Wrong"
}
}
</script>
</html>