为了开这个后门,导致代码又长又多作许多无用功,汗,找不到更好的方法,先凑合着用
思路:
先将400名学生分成4组,再乱序,然后在每班每组按顺序取10个,
并同时记录下后门学生所在班级,再记录下3班一名高等生和8班一名差等生
最后把3班的这名高等生编到b60所在班,把b60强行编到3班
8班也是
:- @echo off&setlocal EnableDelayedExpansion
- for %%a in (a b c d) do call :loop %%a
- for /l %%a in (1 1 10) do (
- set /a t+=1,w+=10
- for %%i in (a b c d) do (
- for /l %%j in (!t! 1 !w!) do (
- set #%%a=!#%%a! !.%%i%%j!
- set tmp=!.%%i%%j!
- if "!.%%i%%j!"=="b60" set j=%%a
- if %%a equ 3 if "!tmp:~0,1!"=="b" if not "!tmp!"=="b60" set t3=!tmp!
- if "!.%%i%%j!"=="c49" set wen=%%a
- if %%a equ 8 if "!tmp:~0,1!"=="c" if not "!tmp!"=="c49" set t8=!tmp!
- )
- )
- set /a t=w
- )
- echo 两个后门学生原来所在班 !j! !wen!&echo;
- for %%a in (!j!) do set #%%a=!#%%a:b60=! !t3!
- for %%a in (!wen!) do set #%%a=!#%%a:c49=! !t8!
- set #3=!#3! b60
- set #8=!#8! c49
-
- for /l %%a in (1 1 10) do (
- echo %%a班
- echo !#%%a!
- echo;
- )
- pause&exit
-
- :loop
- for /l %%i in (1 1 100) do set .%1%%i=%1%%i
- for /l %%i in (1 1 100) do (
- set /a rnd=!random!%%100+1
- for %%j in (!rnd!) do set tmp=!.%1%%j!
- set .%1!rnd!=!.%1%%i!
- set .%1%%i=!tmp!
- )
- goto :EOF
复制代码
|