zoukankan      html  css  js  c++  java
  • JSP第一周作业3.3

    完成环境变量配置及第一次输出

    <%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
    <%
    	String path = request.getContextPath();
    	String basePath = request.getScheme() + "://"
    			+ request.getServerName() + ":" + request.getServerPort()
    			+ path + "/";
    %>
    
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <html>
    <head>
    <base href="<%=basePath%>">
    
    <title>My JSP 'index.jsp' starting page</title>
    <meta http-equiv="pragma" content="no-cache">
    <meta http-equiv="cache-control" content="no-cache">
    <meta http-equiv="expires" content="0">
    <meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
    <meta http-equiv="description" content="This is my page">
    <!--
    	<link rel="stylesheet" type="text/css" href="styles.css">
    	-->
    </head>
    
    <body>
    	我的第一个页面
    	<br>
    </body>
    </html>
    

      

    编写jsp页面,计算1-100之间所有素数和

    <%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
    <%
    	String path = request.getContextPath();
    	String basePath = request.getScheme() + "://"
    			+ request.getServerName() + ":" + request.getServerPort()
    			+ path + "/";
    %>
    
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <html>
    <head>
    <base href="<%=basePath%>">
    
    <title>My JSP 'index.jsp' starting page</title>
    <meta http-equiv="pragma" content="no-cache">
    <meta http-equiv="cache-control" content="no-cache">
    <meta http-equiv="expires" content="0">
    <meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
    <meta http-equiv="description" content="This is my page">
    <!--
    	<link rel="stylesheet" type="text/css" href="styles.css">
    	-->
    </head>
    
    <body>
    	我的第一个页面
    	<br>
    	<%
    		int s, count = 0;
    		for (int i = 2; i <= 100; i++) {
    			for (s = 2; s < i; s++) {
    				if (i % s == 0)
    					break;
    			}
    			if (s == i)
    				count += s;
    
    		}
    		out.print(count);
    	%>
    </body>
    </html>
    

      

  • 相关阅读:
    bzoj 2763: [JLOI2011]飞行路线
    bzoj 2761: [JLOI2011]不重复数字
    bzoj 2744: [HEOI2012]朋友圈
    bzoj 2743: [HEOI2012]采花
    bzoj 2730: [HNOI2012]矿场搭建
    bzoj 2705: [SDOI2012]Longge的问题
    抗DDOS攻击
    kali安装后配置
    Kali更新源,亲测目前可用的源
    kali安装及配置ssr客户端
  • 原文地址:https://www.cnblogs.com/a000/p/14475243.html
Copyright © 2011-2022 走看看