快活林资源网 Design By www.csstdc.com
九九乘法表 批处理版
复制代码 代码如下:
@echo off
:: 九九乘法表
set num=0
for /l %%i in (1,1,9) do (
for /l %%j in (1,1,%%i) do call :multiply %%i %%j
)
pause>nul
goto :eof

:multiply
set /a num+=1
set /a var=%1*%2
set var=%2×%1=%var%
set var=%var%
if %2 equ 1 (set var=%var:~0,5%) else set var=%var:~0,6%
set str=%str% %var%
if %num% equ %1 echo %str%&set str=&set num=0
goto :eof

:: 另外一种,用Tab键替代空格键来排版
@ECHO %DBG% OFF
SETLOCAL ENABLEDELAYEDEXPANSION
for /l %%i in (1,1,9) do (
for /l %%j in (1,1,%%i) do (
set /a h=%%i*%%j
set /p=%%i×%%j^=!h!    <nul
if %%i==%%j echo.
)
)
pause

@echo off
:: 99 乘法表
setlocal enabledelayedexpansion
for /l %%a in (1,1,9) do (
for /l %%b in (1,1,%%a) do (
set /a i+=1
set /a ans=%%a*%%b
set ans=%%b×%%a=!ans!
set res=!res! !ans:~0,6!
if !i! equ %%a echo!res!&set res=& set i=0
)
)
pause
快活林资源网 Design By www.csstdc.com
广告合作:本站广告合作请联系QQ:858582 申请时备注:广告合作(否则不回)
免责声明:本站资源来自互联网收集,仅供用于学习和交流,请遵循相关法律法规,本站一切资源不代表本站立场,如有侵权、后门、不妥请联系本站删除!
快活林资源网 Design By www.csstdc.com