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


    你好作者,代码很好,我想转用一下,可否?非常感谢!
QQ 1980286392

TOP

我稍微改动了一点,将他英化了
  1. @echo off
  2. :cmd
  3. title Calculator
  4. :start
  5. cls
  6. echo ---------------------
  7. echo MICRODOS CALCULATOR
  8. echo ---------------------
  9. echo.
  10. echo 1.Multiplication
  11. echo.
  12. echo 2.Division
  13. echo.
  14. echo 3.Addition
  15. echo.
  16. echo 4.Subtraction
  17. echo.
  18. echo 5.Decimal Calculate
  19. echo.
  20. echo 6.Multiple Number Calculation
  21. echo.
  22. echo Q.Exit
  23. echo.
  24. set /p user_input=Please select an operation:
  25. if %user_input% equ 1=goto a
  26. if %user_input% equ 2=goto b
  27. if %user_input% equ 3=goto c
  28. if %user_input% equ 4=goto d
  29. if %user_input% equ 5=goto ps
  30. if %user_input% equ 6=goto many
  31. if /i "%user_input%"=="Q" exit /b
  32. cls
  33. echo ERROR!
  34. pause>nul
  35. goto start
  36. :a
  37. cls
  38. echo Please enter the first factor.
  39. set /p "A=>>>"
  40. echo Please enter the second factor.
  41. set /p "B=>>>"
  42. set /a result=%A%*%B%
  43. echo %result%
  44. pause
  45. goto start
  46. :b
  47. cls
  48. echo Please enter dividend.
  49. set /p "A1=>>>"
  50. echo Please enter a divisor.
  51. set /p "B1=>>>"
  52. set /a result=%A1%/%B1%
  53. echo %result%
  54. pause
  55. goto start
  56. :c
  57. cls
  58. echo Please enter the first addend.
  59. set /p "A2=>>>"
  60. echo Please enter the second addend.
  61. set /p "B2=>>>"
  62. set /a result=%A2%+%B2%
  63. echo %result%
  64. pause
  65. goto start
  66. :d
  67. cls
  68. echo Please enter the minuend.
  69. set /p "A3=>>>"
  70. echo Please enter a reduction.
  71. set /p "B3=>>>"
  72. set /a result=%A3%-%B3%
  73. echo %result%
  74. pause
  75. goto start
  76. :ps
  77. title Calculator-PowerShell
  78. :psstart
  79. cls
  80. echo ---------------------
  81. echo MICRODOS CALCULATOR
  82. echo ---------------------
  83. echo.
  84. echo 1.Multiplication
  85. echo.
  86. echo 2.Division
  87. echo.
  88. echo 3.Addition
  89. echo.
  90. echo 4.Subtraction
  91. echo.
  92. echo 5.Integer calculation
  93. echo.
  94. echo Q.Exit
  95. echo.
  96. set /p user_input=Please select an operation:
  97. if %user_input% equ 1=goto psa
  98. if %user_input% equ 2=goto psb
  99. if %user_input% equ 3=goto psc
  100. if %user_input% equ 4=goto psd
  101. if %user_input% equ 5=goto cmd
  102. if /i "%user_input%"=="Q" exit /b
  103. cls
  104. echo ERROR!
  105. pause>nul
  106. goto pssstart
  107. :psa
  108. cls
  109. echo Please enter the first factor.
  110. set /p "psA=>>>"
  111. echo Please enter the second factor
  112. set /p "psB=>>>"
  113. powershell -command " ( %psA% * %psB% ) "
  114. pause
  115. goto psstart
  116. :psb
  117. cls
  118. echo Please enter dividend.
  119. set /p "psA1=>>>"
  120. echo Please enter a divisor.
  121. set /p "psB1=>>>"
  122. powershell -command " ( %psA1% / %psB1% ) "
  123. pause
  124. goto psstart
  125. :psc
  126. cls
  127. echo Please enter the first addend.
  128. set /p "psA2=>>>"
  129. echo Please enter the second addend.
  130. set /p "psB2=>>>"
  131. powershell -command " ( %psA2% + %psB2% ) "
  132. pause
  133. goto psstart
  134. :psd
  135. cls
  136. echo Please enter the minuend.
  137. set /p "psA3=>>>"
  138. echo Please enter a reduction.
  139. set /p "psB3=>>>"
  140. powershell -command " ( %psA3% - %psB3% ) "
  141. pause
  142. goto psstart
  143. :many
  144. title Calculator-More Calculate Way
  145. :mstart
  146. cls
  147. echo ---------------------
  148. echo MICRODOS CALCULATOR
  149. echo ---------------------
  150. echo.
  151. echo 1.Multiplication
  152. echo.
  153. echo 2.Division
  154. echo.
  155. echo 3.Addition
  156. echo.
  157. echo 4.Subtraction
  158. echo.
  159. echo 5.Decimal Calculate
  160. echo.
  161. echo 6.Multiple Number Calculation
  162. echo.
  163. echo Q.Exit
  164. echo.
  165. set /p user_input=Please select an operation:
  166. if %user_input% equ 1=goto ma
  167. if %user_input% equ 2=goto mb
  168. if %user_input% equ 3=goto mc
  169. if %user_input% equ 4=goto md
  170. if %user_input% equ 5=goto ps
  171. if %user_input% equ 6=goto cmd
  172. if /i "%user_input%"=="Q" exit /b
  173. cls
  174. echo ERROR!
  175. pause>nul
  176. goto mstart
  177. :ma
  178. cls
  179. echo.
  180. echo Up to 5 numbers can be calculated simultaneously.
  181. echo.
  182. echo You can choose a number calculation between 3-5
  183. echo.
  184. set /p user_input=Please enter the number of numbers to be calculated:
  185. if %user_input% equ 3=goto 1
  186. if %user_input% equ 4=goto 2
  187. if %user_input% equ 5=goto 3
  188. goto ma
  189. :1
  190. cls
  191. echo Please enter the first factor.
  192. set /p "mA=>>>"
  193. echo Please enter the second factor.
  194. set /p "mB=>>>"
  195. echo Please enter the third factor.
  196. set /p "mC=>>>"
  197. powershell -command " ( %mA% * %mB% * %mC%) "
  198. pause
  199. goto mstart
  200. :2
  201. cls
  202. echo Please enter the first factor
  203. set /p "mA1=>>>"
  204. echo Please enter the second factor
  205. set /p "mB1=>>>"
  206. echo Please enter the third factor
  207. set /p "mC1=>>>"
  208. echo Please enter the fourth factor
  209. set /p "mD1=>>>"
  210. powershell -command " ( %mA1% * %mB1% * %mC1% * %mD1%) "
  211. pause
  212. goto mstart
  213. :3
  214. cls
  215. echo Please enter the first factor
  216. set /p "mA2=>>>"
  217. echo Please enter the second factor
  218. set /p "mB2=>>>"
  219. echo Please enter the third factor
  220. set /p "mC2=>>>"
  221. echo Please enter the fourth factor
  222. set /p "mD2=>>>"
  223. echo Please enter the fifth factor
  224. set /p "mE2=>>>"
  225. powershell -command " ( %mA2% * %mB2% * %mC2% * %mD2% * %mE2%) "
  226. pause
  227. goto mstart
  228. :mb
  229. cls
  230. echo.
  231. echo Up to 5 numbers can be calculated simultaneously.
  232. echo.
  233. echo You can choose a number calculation between 3-5
  234. echo.
  235. set /p user_input=Please enter the number of numbers to be calculated:
  236. if %user_input% equ 3=goto 1a
  237. if %user_input% equ 4=goto 2a
  238. if %user_input% equ 5=goto 3a
  239. goto mb
  240. :1a
  241. cls
  242. echo Please enter the divisor
  243. set /p "mmA=>>>"
  244. echo Enter the first divisor
  245. set /p "mmB=>>>"
  246. echo Enter the second divisor
  247. set /p "mmC=>>>"
  248. powershell -command " ( %mmA% / %mmB% / %mmC%) "
  249. pause
  250. goto mstart
  251. :2a
  252. cls
  253. echo Please enter the divisor
  254. set /p "mmA1=>>>"
  255. echo Enter the first divisor
  256. set /p "mmB1=>>>"
  257. echo Enter the second divisor
  258. set /p "mmC1=>>>"
  259. echo Enter the third divisor
  260. set /p "mmD1=>>>"
  261. powershell -command " ( %mmA1% / %mmB1% / %mmC1% / %mmD1%) "
  262. pause
  263. goto mstart
  264. :3a
  265. cls
  266. echo Please enter the divisor
  267. set /p "mmA2=>>>"
  268. echo Enter the first divisor
  269. set /p "mmB2=>>>"
  270. echo Enter the second divisor
  271. set /p "mmC2=>>>"
  272. echo Enter the third divisor
  273. set /p "mmD2=>>>"
  274. echo Enter the fourth divisor
  275. set /p "mmE2=>>>"
  276. powershell -command " ( %mmA2% / %mmB2% / %mmC2% / %mmD2% / %mmE2%) "
  277. pause
  278. goto mstart
  279. :mc
  280. cls
  281. echo.
  282. echo Up to 5 numbers can be calculated simultaneously.
  283. echo.
  284. echo You can choose a number calculation between 3-5
  285. echo.
  286. set /p user_input=Please enter the number of numbers to be calculated:
  287. if %user_input% equ 3=goto 1b
  288. if %user_input% equ 4=goto 2b
  289. if %user_input% equ 5=goto 3b
  290. goto mc
  291. :1b
  292. cls
  293. echo Please enter the first addition
  294. set /p "mmmA=>>>"
  295. echo Please enter the second addition
  296. set /p "mmmB=>>>"
  297. echo Please enter the third addition
  298. set /p "mmmC=>>>"
  299. powershell -command " ( %mmmA% + %mmmB% + %mmmC%) "
  300. pause
  301. goto mstart
  302. :2b
  303. cls
  304. echo Please enter the first addition
  305. set /p "mmmA=>>>"
  306. echo Please enter the second addition
  307. set /p "mmmB=>>>"
  308. echo Please enter the third addition
  309. set /p "mmmC=>>>"
  310. echo Please enter the fourth addition
  311. set /p "mmmD=>>>"
  312. powershell -command " ( %mmmA% + %mmmB% + %mmmC% + %mmmD%) "
  313. pause
  314. goto mstart
  315. :3b
  316. cls
  317. echo Please enter the first addition
  318. set /p "mmmA=>>>"
  319. echo Please enter the second addition
  320. set /p "mmmB=>>>"
  321. echo Please enter the third addition
  322. set /p "mmmC=>>>"
  323. echo Please enter the fourth addition
  324. set /p "mmmD=>>>"
  325. echo Please enter the fifth addition
  326. set /p "mmmE=>>>"
  327. powershell -command " ( %mmmA% + %mmmB% + %mmmC% + %mmmD% + %mmmE%) "
  328. pause
  329. goto mstart
  330. :md
  331. cls
  332. echo.
  333. echo Up to 5 numbers can be calculated simultaneously.
  334. echo.
  335. echo You can choose a number calculation between 3-5
  336. echo.
  337. set /p user_input=Please enter the number of numbers to be calculated:
  338. if %user_input% equ 3=goto 1c
  339. if %user_input% equ 4=goto 2c
  340. if %user_input% equ 5=goto 3c
  341. goto md
  342. :1c
  343. cls
  344. echo Please enter the minus
  345. set /p "mmmmA=>>>"
  346. echo Please enter the first minus
  347. set /p "mmmmB=>>>"
  348. echo Please enter the second minus
  349. set /p "mmmmC=>>>"
  350. powershell -command " ( %mmmmA% - %mmmmB% - %mmmmC%) "
  351. pause
  352. goto mstart
  353. :2c
  354. cls
  355. echo Please enter the minus
  356. set /p "mmmmA=>>>"
  357. echo Please enter the first minus
  358. set /p "mmmmB=>>>"
  359. echo Please enter the second minus
  360. set /p "mmmmC=>>>"
  361. echo Please enter the third minus
  362. set /p "mmmmD=>>>"
  363. powershell -command " ( %mmmmA% - %mmmmB% - %mmmmC% - %mmmmD%) "
  364. pause
  365. goto mstart
  366. :3c
  367. cls
  368. echo Please enter the minus
  369. set /p "mmmmA=>>>"
  370. echo Please enter the first minus
  371. set /p "mmmmB=>>>"
  372. echo Please enter the second minus
  373. set /p "mmmmC=>>>"
  374. echo Please enter the third minus
  375. set /p "mmmmD=>>>"
  376. echo Please enter the fourth minus
  377. set /p "mmmmE=>>>"
  378. powershell -command " ( %mmmmA% - %mmmmB% - %mmmmC% - %mmmmD% - %mmmmE%) "
  379. pause
  380. goto mstart
复制代码
QQ 1980286392

TOP

返回列表