@echo off 2>nul 3>nul set/a num1=7,num2=2 set/a var=%num1%+%num2% set /a 1/(%var%/10) && echo 大于10 ||echo 小于10 pause>nul 再附一特大数值的加法运算演示代码:(先补位)
复制代码 代码如下:
@echo off&setlocal enabledelayedexpansion set num1=984322212445613542523552165432136516565135132354123432987619431469731611346143789 set num2=657973265856194306419643120641631361303163006131061301613061130161300613061130 call :lineup num1 call :lineup num2 set/a flag=0 for /l %%i in (1 1 199) do ( set/a var=!num1:~-%%i,1!+!num2:~-%%i,1!+!flag! set var=0!var! set flag=!var:~-2,1! set str=!var:~-1!!str! ) for /f "delims=0 tokens=*" %%i in ("!str!") do echo %%i pause>nul
:lineup obj for /l %%i in (1 1 200) do set %1=0!%1! call set %1=!%1:~-200!