[新手上路]批处理新手入门导读[视频教程]批处理基础视频教程[视频教程]VBS基础视频教程[批处理精品]批处理版照片整理器
[批处理精品]纯批处理备份&还原驱动[批处理精品]CMD命令50条不能说的秘密[在线下载]第三方命令行工具[在线帮助]VBScript / JScript 在线参考
返回列表 发帖
回复 1# meiszp


    你最终想得到的结果是啥

TOP

本帖最后由 SQYSQYSQY 于 2019-1-10 21:52 编辑
  1. @echo off
  2. (
  3. rem 变量!z!是最终结果保留的小数位数(如果是无限的话)
  4. set "z=40"
  5. color f0
  6. SetLocal EnableDelayedExpansion
  7. set "c=0"
  8. for /f "tokens=*" %%a in (abc.st) do (
  9. set /a c+=1
  10. set "a=%%a"
  11. set "b=!a:ROTOT=!"
  12. if defined b (
  13. if not "!b!"=="%%a" (
  14. set "b=!b:ROTORMASS=!"
  15. if defined b (
  16. if not "!b!"=="!a!" goto a
  17. )
  18. )
  19. )
  20. )
  21. :a
  22. (
  23. set d=!c!
  24. set "b=0"
  25. for /f "tokens=*" %%a in (abc.st) do (
  26. if not "!b!"=="ture" (
  27. set /a b+=1
  28. if "!b!"=="!c!" (
  29. set "a=%%a"
  30. set "b=ture"
  31. echo !a!
  32. set "c=1"
  33. )
  34. ) else (
  35. set /a "c+=1"
  36. if !c! gtr 5 goto b
  37. set "a=%%a"
  38. echo !a!
  39. )
  40. )
  41. )
  42. :b
  43. (
  44. echo.
  45. set "a=0"
  46. set /a d+=1
  47. set b=
  48. for /f "tokens=1-3" %%a in (abc.st) do (
  49. if not "!b!"=="ture" (
  50. set /a "a+=1"
  51. if "!a!"=="!d!" (
  52. set "b=ture"
  53. set "e=%%c"
  54. set "c=1"
  55. )
  56. ) else (
  57. set /a c+=1
  58. if "!c!"=="4" (
  59. set "f=%%c"
  60. goto c
  61. )
  62. )
  63. )
  64. )
  65. :c
  66. (
  67. set /a "a=13"
  68. set /a "b=3"
  69. set "c=!a!"
  70. set "d=!b!"
  71. for /f "delims=. tokens=1-2" %%a in ("!e!") do (
  72. set s=%%a%%b
  73. set /a "a*=!s!"
  74. set "q=%%b"
  75. call :d q v
  76. for /l %%c in (1 1 !v!) do set "b=!b!0"
  77. )
  78. for /f "delims=. tokens=1-2" %%a in ("!f!") do (
  79. set s=%%a%%b
  80. set /a "c*=!s!"
  81. set "q=%%b"
  82. call :d q v
  83. for /l %%c in (1 1 !v!) do set "d=!d!0"
  84. )
  85. set /a b/=4
  86. set /a d/=4
  87. call :e !a! !b! x
  88. call :e !c! !d! y
  89. echo b=4*6500*!e!/1500=!x!
  90. echo.
  91. echo b=4*6500*!f!/1500=!y!
  92. echo.
  93. echo 计算完毕!
  94. pause
  95. exit /b
  96. )
  97. :d
  98. set i=!%~1!!%~1!!%~1!^
  99. 3FF3FE3FD3FC3FB3FA3F93F83F73F63F53F43F33F23F13F03EF3EE3ED3EC3EB3EA3E93E83E73E63E53E43E33E23E13E03DF3DE3DD3DC3DB3DA3D93D83D73D63D53D43D33D23D13D03CF3CE3CD3CC3CB3CA3C93C83C73C63C53C43C33C23C13C03BF3BE3BD3BC3BB3BA3B93B83B73B63B53B43B33B23B13B03AF3AE3AD3AC3AB3AA3A93A83A73A63A53A43A33A23A13A039F39E39D39C39B39A39939839739639539439339239139038F38E38D38C38B38A38938838738638538438338238138037F37E37D37C37B37A37937837737637537437337237137036F36E36D36C36B36A36936836736636536436336236136035F35E35D35C35B35A35935835735635535435335235135034F34E34D34C34B34A34934834734634534434334234134033F33E33D33C33B33A33933833733633533433333233133032F32E32D32C32B32A32932832732632532432332232132031F31E31D31C31B31A31931831731631531431331231131030F30E30D30C30B30A3093083073063053043033023013002FF2FE2FD2FC2FB2FA2F92F82F72F62F52F42F32F22F12F02EF2EE2ED2EC2EB2EA2E92E82E72E62E52E42E32E22E12E02DF2DE2DD2DC2DB2DA2D92D82D72D62D52D42D32D22D12D02CF2CE2CD2CC2CB2CA2C92C82C72C62C52C42C32C22C12C02BF2BE2BD2BC2BB2BA2B92B82B72B62B52B42B32B22B12B02AF2AE2AD2AC^
  100. 2AB2AA2A92A82A72A62A52A42A32A22A12A029F29E29D29C29B29A29929829729629529429329229129028F28E28D28C28B28A28928828728628528428328228128027F27E27D27C27B27A27927827727627527427327227127026F26E26D26C26B26A26926826726626526426326226126025F25E25D25C25B25A25925825725625525425325225125024F24E24D24C24B24A24924824724624524424324224124023F23E23D23C23B23A23923823723623523423323223123022F22E22D22C22B22A22922822722622522422322222122021F21E21D21C21B21A21921821721621521421321221121020F20E20D20C20B20A2092082072062052042032022012001FF1FE1FD1FC1FB1FA1F91F81F71F61F51F41F31F21F11F01EF1EE1ED1EC1EB1EA1E91E81E71E61E51E41E31E21E11E01DF1DE1DD1DC1DB1DA1D91D81D71D61D51D41D31D21D11D01CF1CE1CD1CC1CB1CA1C91C81C71C61C51C41C31C21C11C01BF1BE1BD1BC1BB1BA1B91B81B71B61B51B41B31B21B11B01AF1AE1AD1AC1AB1AA1A91A81A71A61A51A41A31A21A11A019F19E19D19C19B19A19919819719619519419319219119018F18E18D18C18B18A18918818718618518418318218118017F17E17D17C17B17A17917817717617517417317217117016F16E16D16C16B16A16916816716616516416316216116015F15E15D15C15B15A159158^
  101. 15715615515415315215115014F14E14D14C14B14A14914814714614514414314214114013F13E13D13C13B13A13913813713613513413313213113012F12E12D12C12B12A12912812712612512412312212112011F11E11D11C11B11A11911811711611511411311211111010F10E10D10C10B10A1091081071061051041031021011000FF0FE0FD0FC0FB0FA0F90F80F70F60F50F40F30F20F10F00EF0EE0ED0EC0EB0EA0E90E80E70E60E50E40E30E20E10E00DF0DE0DD0DC0DB0DA0D90D80D70D60D50D40D30D20D10D00CF0CE0CD0CC0CB0CA0C90C80C70C60C50C40C30C20C10C00BF0BE0BD0BC0BB0BA0B90B80B70B60B50B40B30B20B10B00AF0AE0AD0AC0AB0AA0A90A80A70A60A50A40A30A20A10A009F09E09D09C09B09A09909809709609509409309209109008F08E08D08C08B08A08908808708608508408308208108007F07E07D07C07B07A07907807707607507407307207107006F06E06D06C06B06A06906806706606506406306206106005F05E05D05C05B05A05905805705605505405305205105004F04E04D04C04B04A04904804704604504404304204104003F03E03D03C03B03A03903803703603503403303203103002F02E02D02C02B02A02902802702602502402302202102001F01E01D01C01B01A01901801701601501401301201101000F00E00D00C00B00A009008007006005004^
  102. 003002001000&set /a "%2=0x!i:~3069,3!"&goto :eof
  103. :e
  104. set 被除数=%1
  105. set 除数=%2
  106. set g=%3
  107. set /a 余数=!被除数!%%!除数!
  108. set /a 结果=%被除数%/%除数%
  109. set "l="
  110. set l=!l!!结果!.
  111. for /l %%i in (1 1 !z!) do (
  112. set /a 余数后补零=!余数!*10
  113. set /a 结果=!余数后补零!/%除数%
  114. if "!结果:~0,1!"=="-" set 结果=!结果:~-1!
  115. set l=!l!!结果!
  116. set /a 余数=!余数后补零!%%!除数!
  117. if "!余数!"=="0" goto f
  118. )
  119. goto f
  120. :f
  121. set "!g!=!l!"
  122. goto :eof
复制代码
抱歉,我思路很乱,所以可能有不必要命令。
数不能太长,否则会计算失败。
文本内不要有特殊字符。如(&><?|等等
1

评分人数

TOP

返回列表