本帖最后由 CrLf 于 2016-4-10 12:52 编辑
回复 9# happy886rr
咳咳咳...还有更快的批处理吗?- @echo off&setlocal enabledelayedexpansion
- set /a len=9,n[0]=1,n[1]=2
- for /l %%n in (4 1 5000) do (
- set /a n[0]=n[1],n[1]+=!n[0]!
- if !n[1]! gtr 999999999 (
- set /a len+=1,n[0]/=10,n[1]/=10
- if !len!==1000 (set/p =%%n&exit)
- )
- )
复制代码 怪异代码风采大赛参赛作品:- @echo off&setlocal enabledelayedexpansion
- set /a len=9,n[0]=1,n[1]=2
- (for /l %%n in (4 1 5000) do (
- set /a "n[0]=n[1],n[1]+=!n[0]!,1/^!((n[1]=last+n[0])/1000000000)"||(
- set /a "1/(1000-(len+=1)),n[0]/=10,n[1]/=10"||set/p =%%n&&exit
- )
- ))2>nul
复制代码 参赛作品2:- @echo off&setlocal enabledelayedexpansion
- set /a len=9,n[0]=1,n[1]=2
- (for /l %%n in (4 1 5000) do (
- set /a "n[0]=n[1],n[1]+=!n[0]!,1/((n[1]=last+n[0])/1000000000),len+=1,n[0]/=10,n[1]/=10"&&(
- if !len!==1000 set/p =%%n&&exit
- )
- ))2>nul
复制代码
|