edmond 当前离线
少尉
@echo offset t=0for /l %%a in (1 1 100) do (set/a t+=%%a)echo %t%pauseCOPY
TOP
qinshi52 当前离线
列兵
@echo off&setlocal enabledelayedexpansionfor /l %%i in (1,1,100) do set /a s+=%%iecho !s!pauseCOPY
@echo off&setlocal enabledelayedexpansionset /p n=请输入数字:for /l %%i in (1,1,!n!) do set /a s+=%%iecho !b!pauseCOPY
photonjl 当前离线
上等兵
::从1加到100的@echo offset str=0for /l %%i in (1,1,100) do ( set /a str+=%%i)echo %str%pause>nulCOPY
::任意数值的计算@echo offset str=0set /p var=input number for /l %%i in (1,1,%var%) do ( set /a str+=%%i)echo %str%pause>nulCOPY
lys5300 当前离线
二级士官
@echo offset /a sum=0for /l %%a in (1 1 100) do (set/a sum+=%%a)echo %sum%set sum=pause>nulCOPY
smallpigs 当前离线
@echo off:abcclsset /a i = 1set /p n=請輸入數字:if {%n%}=={} goto abc:acbset /a i+=1,j+=iif %i% neq %n% goto acbecho %j%pauseCOPY
lmhxly 当前离线
zsllq 当前离线
@echo offset var=0for /l %%a in (1,1,100) do (set /a var=var+%%a)echo 1+2+3+4+...+100=%var%pause>nulCOPY
weichenxiehou 当前离线
上尉
@echo on&setlocal enabledelayedexpansionset sum=0for /l %%i in (1,1,100) do (set /a sum+=%%i)echo 1+2+...+100=!sum!pauseCOPY
akkk 当前离线
ithinkican 当前离线
wolonga123 当前离线
@echo offset /a sum=0set /p n=请输入一个数字:for /l %%i in (1,1,%n%) do ( set /a sum+=%%i )echo %sum%pauseCOPY
_ThirdMan 当前离线
broly (Broly)当前离线
版主
@set var=0@for /l %%i in (1,1,100) do @call set /a var=%%var%%+%%i@echo %var%@pauseCOPY