返回列表 发帖
@echo off
setlocal enabledelayedexpansion
:111
set /p n=请输入一行数字的个数(25以内)
set /p m=请输入重复的个数
if not defined n goto 111
if not defined m goto 111
set /a b=101
for /l %%a in (1 1 4) do (
    set num=%%a
    set /a a=!num!*!n!+100
    for /l %%i in (!b!,1,!a!) do (
         set str=%%i
         set "e=!e! !str:~1,2!"
)
set /a b=!a!+1
for /l %%i in (1 1 !m!) do set/p=!e!<nul
echo.
set "e="
)
pauseCOPY

[ 本帖最后由 skuny 于 2010-12-25 15:19 编辑 ]

TOP

@echo off

setlocal enabledelayedexpansion

set /p n=请输入块数N:

for /f "delims=" %%i in (1.txt) do (

set a=

for /l %%j in (1 1 %n%) do set a=!a! %%i

echo !a!

)

TOP

想用1句把它输出来,结果没实现
@echo off
set "aa=01 02 03 04"
set "bb=05 06 07 08"
set "cc=09 10 11 12"
set /p sr=请输入数据:
cls
for /l %%a in (1 1 %sr%) do (set /p =%aa%<nul )
echo=
for /l %%c in (1 1 %sr%) do (set /p =%bb%<nul )
echo=
for /l %%d in (1 1 %sr%) do (set /p =%cc%<nul )
echo=
pause>nulCOPY

TOP

@echo off
set "a=01 02 03 04" & set "b=05 06 07 08"
set "c=09 10 11 12" & set "d=13 14 15 16"
set "str=abcd" & set /a n=0  
set /p ncount=请输入列数:
:again
call call set "s=%%%%str:~%n%,1%%%%"
for /l %%i in (1,1,%ncount%) do (call set /p=%%%s%%% <nul)
echo. & set /a n+=1
if %n% lss 4 goto :again
pause>nulCOPY

TOP

本帖最后由 shelluserwlb 于 2014-12-24 15:54 编辑

回复 3# vsbat
代码中应尽量不要使用临时文件吧。

TOP

返回列表