Compare commits

...

No commits in common. 'main' and 'master' have entirely different histories.
main ... master

@ -1,2 +0,0 @@
# jisuanqi

@ -1,4 +0,0 @@
public class Test {
}

@ -26,7 +26,7 @@
width: 100%; width: 100%;
height: 50px; height: 50px;
margin-bottom: 10px; margin-bottom: 10px;
padding: 0px; padding: 10px;
font-size: 24px; font-size: 24px;
text-align: right; text-align: right;
border: none; border: none;
@ -81,8 +81,6 @@
<button onclick="appendNumber('.')">.</button> <button onclick="appendNumber('.')">.</button>
<button onclick="compute()">=</button> <button onclick="compute()">=</button>
<button onclick="chooseOperation('+')">+</button> <button onclick="chooseOperation('+')">+</button>
<button onclick="chooseOperation('%')">%</button>
<button onclick="appendNumber('-')">±</button>
</div> </div>
</div> </div>
@ -95,7 +93,6 @@
function appendNumber(number) { function appendNumber(number) {
if (number === '.' && currentOperand.includes('.')) return; if (number === '.' && currentOperand.includes('.')) return;
if (number === '-' && currentOperand.length > 0) return; // 防止在数字中间添加负号
currentOperand += number; currentOperand += number;
updateDisplay(); updateDisplay();
} }
@ -128,9 +125,6 @@
case '/': case '/':
computation = prev / current; computation = prev / current;
break; break;
case '%':
computation = prev % current;
break;
default: default:
return; return;
} }

Loading…
Cancel
Save