第一周作业

1.环境搭建,运行出来一个JSP页面,显式hello
 <%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
  </head>
  <body>
    Hello! <br>
  </body>
</html>

  

2.英文字母表
 <%@ 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>

  </head>
  
  <body>
     <p>英文字母:</p>
    <% 
    for(char a='A';a<='Z';a++){
             out.print(a+"("+(char)(a+32)+")"+"  ");
    }      
    %>
    
    <br>
  </body>
</html>

  

3.99乘法表
<%@ 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>


  </head>
  
  <body>
      <p>九九乘法表:<p/>
    <%
    for(int j=1;j<=9;j++){
    for(int i=1;i<=j;i++){
    int n=i*j;
    out.print(i+"x"+j+"="+n+" ");
    }
    out.print("<br>");
    } 
     %>
    
    
    
   <br>
  </body>
</html>

 

  

 

posted @ 2022-03-06 17:48  计算机1902张铭麟  阅读(2)  评论(0编辑  收藏  举报