不运行代码,猜猜下面代码输出什么?- @echo off
- setlocal enabledelayedexpansion
- (
- set "s=^!x^!"
- set x=2
- set ss=abc
- echo 1. !ss:~%x%,1!
- )
- echo 2. !ss:~%x%,1!
- for %%a in (!x!)do echo 3. !ss:~%%a!
- for %%a in (!s!)do echo 4. !ss:~%%a!
- for %%a in (!s!)do echo 5. !ss:~!%%a
- for %%a in (!s!)do echo 6. !ss:~%%a!-!ss:~!%%a
- for %%a in (!s!)do echo 7. !ss:~%%a!-!-!ss:~!%%a
- for %%a in (!s!)do echo 8. "!ss:~^%%a!"-!-^"!ss:~!^%%a
- for %%a in (^^!s!)do echo 9. !ss:~%%a!-!-!ss:~!%%a!
- for %%a in (!s^^!)do echo 0. !ss:~%%a!-!-!ss:~!%%a
- pause
复制代码 共10行,第一行回答正确则为第一层,类推;第10行猜“对”了,一切归零;
10行全回答正确;你的批处理内功应该是非常牛X了,变量延迟的掌握算得上精通了 |