```
@echo off
set code=0123456789abcdef
:enter
cls&set /p num=Please enter a decimal number:
echo %num%|findstr ""&&goto enter
set var=%num%
:again
set /a ws=%var%%%16
call,set ws=%%code:~%ws%,1%%
set /a var/=16
set str=%ws%%str%
if %var% geq 16 goto again
cls&echo The decimal number %num% is converted to hexadecimal as: %var%%str%
pause>nul
```
[ Last edited by zw19750516 on 2008-7-5 at 01:50 PM ]
@echo off
set code=0123456789abcdef
:enter
cls&set /p num=Please enter a decimal number:
echo %num%|findstr ""&&goto enter
set var=%num%
:again
set /a ws=%var%%%16
call,set ws=%%code:~%ws%,1%%
set /a var/=16
set str=%ws%%str%
if %var% geq 16 goto again
cls&echo The decimal number %num% is converted to hexadecimal as: %var%%str%
pause>nul
```
[ Last edited by zw19750516 on 2008-7-5 at 01:50 PM ]
Recent Ratings for This Post
( 1 in total)
Click for details
| Rater | Score | Time |
|---|---|---|
| WANKOILZ | +2 | 2008-07-07 14:53 |
批处理之家新域名:www.bathome.net



