- @echo off
- setlocal enabledelayedexpansion
- ::选择排序法
- echo 共输入10个数
- for /l %%i in (1,1,10) do (
- set /p a_%%i=请输入%%i个数
- set str=!str! !a_%%i!
- )
- echo %str%
- for /l %%i in (1,1,10) do (
- set /a b=%%i+1
- for /l %%j in (!b!,1,10) do (
- if !a_%%i! gtr !a_%%j! (
- set /a t=a_%%i
- set /a a_%%i=a_%%j
- set /a a_%%j=t
- )
- )
- )
- for /l %%i in (1,1,10) do (
- set str1=!str1! !a_%%i!
- )
- echo %str1%
- pause>nul
复制代码 请问这行“set str=!str! !a_%%i!”命令中的“!str! !a_%%i!”
是什么意思啊 ?为什么有2个变量没用其他运算符,而是空格 |