我正在批量编程,使用forall n
介于1和100之间,(2^n-2) mod n
如果n
为素数则为0,否则为0。当我运行程序时,出现“缺少运算符”错误。我的代码中有什么缺陷?
@echo off
color F0
title Prime Number Checker
echo --------------------------------------------------------
echo Prime Number Checker v1.0
echo --------------------------------------------------------
echo.
set /p n=Enter a number between 1 and 100:
set result=1
set i=1
:multiply
set /a result=result*2
set /a i=i+1
if %i% lss %n% goto multiply
set /a result = result - 2
set /a result = result % n
if %result% == 0 echo The number is prime.
if %result% NEQ 0 echo The number is not prime.
pause <nul