我正在尝试使用Prolog从1到10打印所有偶数,这是我的代码
<div class="dropdown">
<button onclick="dropDownMenu()" class="dropbtn">Change Date
Filter</button>
<div id="myDropdown" class="dropdown-content">
<a href="#" onclick="return switchDateOptions();">Date Picker</a>
<a href="#" onclick="return switchDateOptions();">Date Slider</a>
</div>
</div>
但是当我编写以下查询时,它会将我打印为“false”:
printn(10):- write(10).
printn(X):- (X mod 2 =:= 0 -> write(X), Next is X+1, nl, printn(Next)).