返回列表 发帖
print("=======================论回字的第五种写法============")
l=list(a)
ta=tb=tc=td=''
for r in range(0,9):
    ta+=l.pop(0)
    tb+=l.pop(0)
    tc+=l.pop(0)
    td+=l.pop(0)
print(ta)
print(tb)
print(tc)
print(td)COPY

TOP

print("==========试试回字的第六种写法好不好使==========")
lena=len(a)
t=''
lena=len(a)
for s in range(0,4):
    t=''   
    for l in range(s,lena,4):
        t+=a[l]
    print(t)COPY

TOP

@echo off &setlocal enabledelayedexpansion
set var=aA1一bB2二cC3三dD4四eE5五fF6六gG7七hH8八iI9九&set /a a=0
:loop
for /l %%a in (%a%,4,36) do set/p=!var:~%%a,1!<nul
echo;&if !a! lss 3 set /a a+=1 & goto loop
pause&exitCOPY

TOP

@echo off & setlocal EnableDelayedExpansion
set strs=aA1一bB2二cC3三dD4四eE5五fF6六gG7七hH8八iI9九
:loop
set str=!strs:~0,4!
for /l %%i in (0,1,3) do ( set "str%%i=!str%%i!!str:~%%i,1!" )
set strs=!strs:~4!
if defined strs ( goto :loop )
for /l %%i in (0,1,3) do ( echo !str%%i! )COPY

TOP

@echo off
setlocal enabledelayedexpansion
set var=aA1一bB2二cC3三dD4四eE5五fF6六gG7七hH8八iI9九
:a
set /a n+=1
set /a m=(n-1)%%4
set str%m%=!str%m%!!var:~%m%,1!
if %m%==3 set var=%var:~4%
if not "%var%"=="" goto a
for /l %%a in (0,1,3) do echo,!str%%a!
pauseCOPY

TOP

返回列表