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

    1.消费总和

    <%@ page import="java.util.regex.Pattern" %>
    <%@ page import="java.util.regex.Matcher" %><%--
      Created by IntelliJ IDEA.
      User: 86177
      Date: 2021/3/17
      Time: 11:38
      To change this template use File | Settings | File Templates.
    --%>
    <%@ page contentType="text/html;charset=UTF-8" language="java" %>
    <html>
    <head>
        <title>消费总和</title>
    </head>
    <style>
        body{
            background: black;
        }
    </style>
    <%!
        public double getPriceSum(String input){
            Pattern pattern;
            Matcher matcher;
            String regx="-?[0-9][0-9]*[.]?[0-9]*";
            pattern=Pattern.compile(regx);
            matcher=pattern.matcher(input);
            double sum=0;
            while (matcher.find()){
                String str=matcher.group();
                sum+=Double.parseDouble(str);
            }
            return sum;
        }
    %>
    <body>
    <p style="font-family: 黑体;font-size:20px;color: aqua">
        <span style="color: red">孙何伟</span>的菜单 <br>
        <%
            String str="麻婆豆腐:20.6元,红烧肉:68.9元";
        %>
        <br><%=str%>
        <br>
        <br>消费总和: <span style="color: chartreuse"><%= getPriceSum(str)%></span></p>
    <hr size="4">
    <p style="font-family: 黑体;font-size:20px;color: pink">
        <span style="color: red">sun he wei is sb</span>的菜单 <br>
        <%
             str="剁椒鱼头:62.9元,烤鸭:199元,红焖大虾:288.9元";
        %>
        <br><%=str%>
        <br>
        <br>消费总和: <span style="color: chartreuse"><%= getPriceSum(str)%></span></p>
    </body>
    </html>

     2.日期时间

    <%@ page import="java.util.Date" %>
    <%@ page import="java.text.SimpleDateFormat" %><%--
      Created by IntelliJ IDEA.
      User: 86177
      Date: 2021/3/17
      Time: 11:38
      To change this template use File | Settings | File Templates.
    --%>
    <%@ page contentType="text/html;charset=UTF-8" language="java" %>
    <html>
    <head>
        <title>日期时间</title>
    </head>
    <%
        Date date=new Date();
        SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        String time=sdf.format(date);
    %>
    <body>
    <h1>显示访问页面的时期、时间</h1>
    <p style="color: black;font-size: 35px">(服务器端的日期、时间)</p>
    <p style="font-size: 20px;font-weight: 700">用户在 <span style="color: red"><%=time%></span> 访问了该网页。</p>
    </body>
    </html>

     3.听英语

    <%--
      Created by IntelliJ IDEA.
      User: 86177
      Date: 2021/3/17
      Time: 11:38
      To change this template use File | Settings | File Templates.
    --%>
    <%@ page contentType="text/html;charset=UTF-8" language="java" %>
    <html>
    <head>
        <title>听英语</title>
    </head>
    <style>
        body{
            background: black;
            color: aqua;
        }
    </style>
    <body>
    英文课文(English Text): <br>
    <p style="font-family: 宋体;font-size: 18px;color: azure">
        <jsp:include page="english/english.text" flush="true"/>
    课文音频(English Audio):<br>
        <jsp:include page="audio.jsp"/>
    </p>
    </body>
    </html>
    <%--
      Created by IntelliJ IDEA.
      User: 86177
      Date: 2021/3/17
      Time: 12:57
      To change this template use File | Settings | File Templates.
    --%>
    <%@ page contentType="text/html;charset=UTF-8" language="java" %>
    <html>
    <head>
        <title>Title</title>
    </head>
    <style>
        body{
            /*background: black;*/
        }
    </style>
    <body>
    <embed src="english/CMJ%20-%20所念皆星河.mp3" autostart="flase">
    课文音频在左边
    </embed>
    </body>
    </html>

  • 相关阅读:
    BZOJ 3205 [Apio2013]机器人 ——斯坦纳树
    BZOJ 3782 上学路线 ——动态规划 Lucas定理 中国剩余定理
    HDU 1423 Greatest Common Increasing Subsequence ——动态规划
    BZOJ 3309 DZY Loves Math ——莫比乌斯反演
    POJ 1038 Bugs Integrated, Inc. ——状压DP
    POJ 3693 Maximum repetition substring ——后缀数组
    POJ 2699 The Maximum Number of Strong Kings ——网络流
    POJ 2396 Budget ——有上下界的网络流
    BZOJ 4650 [Noi2016]优秀的拆分 ——后缀数组
    源码安装python
  • 原文地址:https://www.cnblogs.com/skyfail/p/14548773.html
Copyright © 2011-2022 走看看