zoukankan      html  css  js  c++  java
  • JSP第三次作业

    <%@ page language="java" contentType="text/html; charset=UTF-8"
        pageEncoding="UTF-8"%>
    <%@ include file="circle.jsp" %>
    <%@ include file="ladder.jsp" %>
    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <html>
        <head>
            <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
            <title>Insert title here</title>
        </head>
        <body>
    
        </body>
    </html>
    <%@ page language="java" contentType="text/html; charset=UTF-8"
        pageEncoding="UTF-8"%>
    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <meta charset="UTF-8">
    <title>Insert title here</title>
    </head>
    <body>
        <div>
            <form action="main.jsp">
                <input type="number" name="A" placeholder="请输入梯形的上底"><br>
                <input type="number" name="B" placeholder="请输入梯形的下底"><br>
                <input type="number" name="H" placeholder="请输入梯形的高"><br>
                <input type="submit" value="计算">
            </form>
        </div>
        <%
            String A=request.getParameter("A");
            String B=request.getParameter("B");
            String H=request.getParameter("H");
            if(A!=null&&B!=null&&H!=null){
                double a=Double.parseDouble(A);
                double b=Double.parseDouble(B);
                double h=Double.parseDouble(H);
                double ls=(a+b)*h/2;
                out.print("梯形的面积为:"+ls);
                request.setAttribute("a", a);
                request.setAttribute("xd", b);
                request.setAttribute("h", h);
                request.setAttribute("ls", ls);
            }
        %>
    </body>
    </html>
    <%@ page language="java" contentType="text/html; charset=UTF-8"
        pageEncoding="UTF-8"%>
    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>Insert title here</title>
    </head>
    <body>
    <div>
            <form action="main.jsp">
                <input type="number" name="R" placeholder="请输入圆的半径"><br>
                <input type="submit" value="计算">
            </form>
        </div>
        <%
            String R=request.getParameter("R");
            if(R!=null){
                double r=Double.parseDouble(R);
                double s=r*r*3.14;
                out.print("圆的面积为"+s);
                request.setAttribute("s", s);
            }
        %>
    </body>
    </html>

  • 相关阅读:
    deepsort+yolov3实现多类别多目标跟踪
    WAR2020暑期补题集
    【数据结构】浅谈主席树
    Github本地上传命令
    【蓝桥杯】2017年第八届蓝桥杯C/C++B组省赛——C题 承压计算
    【蓝桥杯】2017年第八届蓝桥杯C/C++B组省赛——B题 等差素数列
    【蓝桥杯】2019年第十届蓝桥杯C/C++ B组省赛——I题 后缀表达式
    防御Mimikatz-转载
    SQL注入之判断数据库
    XPATH注入
  • 原文地址:https://www.cnblogs.com/shenxiaoqi/p/12562509.html
Copyright © 2011-2022 走看看