```html
body {
fontfamily: Arial, sansserif;
margin: 0;
padding: 20px;
}
h1 {
textalign: center;
color: 333;
}
.container {
maxwidth: 800px;
margin: 0 auto;
}
.formgroup {
marginbottom: 20px;
}
label {
fontweight: bold;
display: block;
marginbottom: 5px;
}
textarea {
width: 100%;
height: 200px;
padding: 10px;
fontsize: 16px;
border: 1px solid ccc;
borderradius: 5px;
}
button {
backgroundcolor: 007bff;
color: fff;
border: none;
padding: 10px 20px;
fontsize: 16px;
borderradius: 5px;
cursor: pointer;
}
button:hover {
backgroundcolor: 0056b3;
}
.result {
margintop: 20px;
border: 1px solid ccc;
borderradius: 5px;
padding: 20px;
}
.result pre {
whitespace: prewrap;
wordwrap: breakword;
}
在线代码测试器
function testCode() {
var code = document.getElementById('code').value;
try {
var result = eval(code);
document.getElementById('output').textContent = result;
} catch (error) {
document.getElementById('output').textContent = "代码运行出错:\n" error;
}
}