如何编写一个加法器?

网络编程 2021-07-05 11:26www.168986.cn编程入门

如何编写一个加法器?

<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>

Copyright © 2016-2025 www.168986.cn 狼蚁网络 版权所有 Power by