netbenton (秋风夜雨)当前离线
荣誉版主
TOP
@echo off&setlocal enabledelayedexpansion :lp set str= set in= (set /p in=输入总人数: set /p m=从第几个开始: if "!in!"=="%in%" goto :eof for /l %%a in (1,1,!in!) do (call set str=!str!%%a )) set str= !str! set n= :rep for %%a in (!str!) do (set/a n+=1 if !n! equ 3 (set str=!str: %%a = !&set n=0) ) echo "!str!" if " !str: =! " neq "!str!" goto :rep set/a l=(m+!str!+in-1)%%in,1/l>nul||set/a l=in echo 共有%in%人一起游戏,从第%m%个开始,最后剩下第%l%个 goto :lp复制代码
inittab 当前离线
中尉
@echo off set /p n= 参加游戏人数: set /p k=从几号开始: set /p m=报数: set s=0 for /l %%a in (2,1,%n%) do set /a s=(s+m)%%%%a set /a x=(s+k)%%n if %x% equ 0 (set x=%n%) echo 最后剩下是:%x%复制代码
评分人数
qixiaobin0715 当前离线
大校
@echo off set /a x=13,y=29,z=3,m=0,n=0 setlocal enabledelayedexpansion :o for /l %%a in (!x!,1,!y!) do ( if not defined #%%a ( set /a m+=1 set /a l=m%%z if !l!==0 ( set #%%a=false set /a n+=1 if !n! == !y! echo %%a&goto :p ) ) ) if !n! lss !y! set x=1&goto :o :p pause goto :eof复制代码
lengmoke 当前离线
列兵
@echo off setlocal enabledelayedexpansion set start=13 set "numbers= " for /l %%i in (1,1,30) do ( if !start! equ 31 ( set /a start=1 ) set numbers=!numbers!!start! set /a start+=1 ) set /a n=1 :loop if "%numbers:~4%" neq "" ( for %%i in (%numbers%) do ( if "!n!" equ "3" ( set "numbers=!numbers: %%i = !" & set /a n=1 ) set /a n+=1 ) goto :loop ) echo %numbers: =%复制代码