[過去ログ] 【.cmd】 バッチファイルスクリプト %12 【.bat】©2ch.net (1002レス)
上下前次1-新
このスレッドは過去ログ倉庫に格納されています。
次スレ検索 歴削→次スレ 栞削→次スレ 過去ログメニュー
509(3): 2018/05/02(水)03:07 ID:KFhIKBMV(1/5) AAS
batでも出来るんだけど、実用な時間で出来るかと言われると何ともねえ
@echo off
setlocal
set hex=0123456789ABCDEF
set in=1234567890
set out=
set bin=
:loop
call :div2 in s
set bin=%s%%bin%
if defined in goto :loop
:loop2
set h=000%bin:~-4%
set /a h=("%h:~-4,1%<<3")+("%h:~-3,1%<<2")+("%h:~-2,1%<<1")+%h:~-1%
set bin=%bin:~0,-4%
call set out=%%hex:~%h%,1%%%out%
if defined bin goto :loop2
echo.0x%out%
endlocal
goto :eof
:div2
set dst=
set s=0
:divloop
set d=%in:~0,1%
set in=%in:~1%
set /a s=s*10+d
set /a h="s>>1"
set /a s%%=2
if defined dst (set dst=%dst%%h%) else if %h% gtr 0 set dst=%dst%%h%
if not defined in set in=%dst%&goto :eof
goto :divloop
上下前次1-新書関写板覧索設栞歴
あと 493 レスあります
スレ情報 赤レス抽出 画像レス抽出 歴の未読スレ
ぬこの手 ぬこTOP 0.017s