结果基本正确,但还是不知道这是什么原理.
数学等于零
简化了一点,不知道还能不能更简洁?
:- @echo off&setlocal EnableDelayedExpansion
- set size=19337576448&set "var=!size:~0,4!"
- for /l %%i in (5 1 100) do (
- set var=!var!!size:~%%i,1!
- set /a "res_=var/1024,var=var%%1024"
- set "str=!str!!res_!"
- if "!size:~%%i,1!"=="" goto :result
- )
- :result
- for /f "delims=0 tokens=*" %%i in ("!str!") do (
- set /a "var=%%i/1024/1024,yu=%%i%%1024"
- )
- echo !var!.!yu! G
- pause>nul
复制代码
[ 本帖最后由 随风 于 2007-12-7 10:20 编辑 ] |