Wacky_rubia

calc

Dec 14th, 2013
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.32 KB | None | 0 0
  1. @echo off
  2. setlocal enabledelayedexpansion
  3. if "%1" == "/?" echo Hello! Write numbers and operations. For example 2 + 3. & goto :eof
  4. set x=
  5. set ans=
  6. set x=%1
  7. if "%1"=="" set /p x=write!
  8. :start
  9. shift
  10. set x=%x% %1
  11. if "%1"=="" (
  12. set /a ans=!x! 2>nul || set ans=error
  13. echo !ans!
  14. endlocal & goto :eof
  15. )
  16. goto :start
Advertisement
Add Comment
Please, Sign In to add comment