Advertisement
Guest User

Binärrechner.bat

a guest
Aug 31st, 2013
147
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.06 KB | None | 0 0
  1. @echo off
  2. title Binaerrechner
  3. color 0A
  4. :main
  5. set A=0
  6. set B=0
  7. set C=0
  8. set D=0
  9. set E=0
  10. set F=0
  11. set G=0
  12. set H=0
  13. set Zahl=0
  14. cls
  15. echo.
  16. echo Binaerrechner
  17. echo (Developed by **** *******)
  18. echo.
  19. echo Bitte geben sie eine Zahl ein,
  20. echo die sie in das Binaersystem
  21. echo umrechnen wollen.
  22. echo (Von 1-255)
  23. echo.
  24. set /p Zahl=
  25. :ZA
  26. if %Zahl% GEQ 128 goto AA
  27. :ZB
  28. if %Zahl% GEQ 64 goto AB
  29. :ZC
  30. if %Zahl% GEQ 32 goto AC
  31. :ZD
  32. if %Zahl% GEQ 16 goto AD
  33. :ZE
  34. if %Zahl% GEQ 8 goto AE
  35. :ZF
  36. if %Zahl% GEQ 4 goto AF
  37. :ZG
  38. if %Zahl% GEQ 2 goto AG
  39. :ZH
  40. if %Zahl%==1 goto AH
  41. goto main
  42.  
  43. :Anzeige
  44. cls
  45. echo.
  46. echo Binaercode:
  47. echo %A%%B%%C%%D%%E%%F%%G%%H%
  48. pause >nul
  49. cls
  50. goto main
  51.  
  52.  
  53. :AA
  54. set /a Zahl=%Zahl%-128
  55. set A=1
  56. goto ZB
  57.  
  58. :AB
  59. set /a Zahl=%Zahl%-64
  60. set B=1
  61. goto ZC
  62.  
  63. :AC
  64. set /a Zahl=%Zahl%-32
  65. set C=1
  66. goto ZD
  67.  
  68. :AD
  69. set /a Zahl=%Zahl%-16
  70. set D=1
  71. goto ZE
  72.  
  73. :AE
  74. set /a Zahl=%Zahl%-8
  75. set E=1
  76. goto ZF
  77.  
  78. :AF
  79. set /a Zahl=%Zahl%-4
  80. set F=1
  81. goto ZG
  82.  
  83. :AG
  84. set /a Zahl=%Zahl%-2
  85. set G=1
  86. goto ZH
  87.  
  88. :AH
  89. set /a Zahl=%Zahl%-1
  90. set H=1
  91. goto Anzeige
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement