JBTALKS.CC
标题:
请问有人知道关于batch用if goto set/A 弄乘法表吗
[打印本页]
作者:
ZiyaoNg
时间:
2015-10-12 03:36 PM
标题:
请问有人知道关于batch用if goto set/A 弄乘法表吗
比如我要输入一个3 就会出现
1x1
2x1
3x1
4x1
5x1
6x1 以此推类 到12x3 的方法
目前我只会
@echo off
set name=ng
echo name : %name%
set /p x=
set /a total=%x%*1
echo 1 * %x% = %total%
set /a total=%x%*2
echo 2 * %x% = %total%
set /a total=%x%*3
echo 3 * %x% = %total%
set /a total=%x%*4
echo 4 * %x% = %total%
set /a total=%x%*5
echo 5 * %x% = %total%
set /a total=%x%*6
echo 6 * %x% = %total%
set /a total=%x%*7
echo 7 * %x% = %total%
set /a total=%x%*8
echo 8 * %x% = %total%
set /a total=%x%*9
echo 9 * %x% = %total%
set /a total=%x%*10
echo 10 * %x% = %total%
set /a total=%x%*11
echo 11 * %x% = %total%
set /a total=%x%*12
echo 12 * %x% = %total%
pause
欢迎光临 JBTALKS.CC (https://www.jbtalks.cc/)
Powered by Discuz! X2.5