|
|
|
|
î¤éÞ / 2007-03-09 / ¿ÀÀü 1:31:42 / 221.152.73.203
Á¶È¸¼ö : 960
|
[Áú¹®] Áø¹ý º¯È¯ |
<%
a1 = "1010"
b1 = "0101"
%>
<%a2=BinToN(a1, 2)%><%=a2%><BR><BR>
<%b2=BinToN(b1, 2)%><%=b2%><BR><BR>
<%c2=a2 or b2%><%=c2%><BR><BR>
<%=DecToN(c2, 2)%>
<%
function BinToN(byval strValue, intNotation)
intLen = Len(strValue)
for i = 1 to intLen
intCipher = Int(Mid(strValue, intLen-i+1, 1))
intResult = intResult + (intNotation^(i-1) * intCipher)
next
BinToN=intResult
end function
%>
<%
function DecToN(byval strValue, intNotation)
strResult=""
do while true
strResult=(strValue Mod intNotation) & strResult
strValue=(strValue - (strValue Mod intNotation)) / intNotation
if strValue=0 then exit do
loop
DecToN = strResult
end function
%> |
|
|