[新手上路]批处理新手入门导读[视频教程]批处理基础视频教程[视频教程]VBS基础视频教程[批处理精品]批处理版照片整理器
[批处理精品]纯批处理备份&还原驱动[批处理精品]CMD命令50条不能说的秘密[在线下载]第三方命令行工具[在线帮助]VBScript / JScript 在线参考
返回列表 发帖
  1. print("=======================论回字的第五种写法============")
  2. l=list(a)
  3. ta=tb=tc=td=''
  4. for r in range(0,9):
  5.     ta+=l.pop(0)
  6.     tb+=l.pop(0)
  7.     tc+=l.pop(0)
  8.     td+=l.pop(0)
  9. print(ta)
  10. print(tb)
  11. print(tc)
  12. print(td)
复制代码

TOP

  1. print("==========试试回字的第六种写法好不好使==========")
  2. lena=len(a)
  3. t=''
  4. lena=len(a)
  5. for s in range(0,4):
  6.     t=''   
  7.     for l in range(s,lena,4):
  8.         t+=a[l]
  9.     print(t)
复制代码

TOP

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

TOP

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

TOP

  1. @echo off
  2. setlocal enabledelayedexpansion
  3. set var=aA1一bB2二cC3三dD4四eE5五fF6六gG7七hH8八iI9九
  4. :a
  5. set /a n+=1
  6. set /a m=(n-1)%%4
  7. set str%m%=!str%m%!!var:~%m%,1!
  8. if %m%==3 set var=%var:~4%
  9. if not "%var%"=="" goto a
  10. for /l %%a in (0,1,3) do echo,!str%%a!
  11. pause
复制代码

TOP

返回列表