当前位置:首页 >> 网络编程

如何编写一个加法器?

如何编写一个加法器?

<form action="./calculation.asp">

<input type="text" size="1" name="op1 value=<%Response.Write Request("op1")%

<input type="submit" name="operation value="plus">

<input type="text" size="1" name="op2 value=<%Response.Write Request("op2")%

equals

<%

   Dim result

   If Request("operation") = "plus" Then

      result = CLng(Request("op1")) + CLng(Request("op2"))

   Else

      result = "?"

   End If

   Response.Write result

%> 

</form>