JSP第一次作业

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

1
2
3
4
5
6
7
8
9
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
 
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
  </head>
  
  <body>
  <p>英文字母表:</p> <em id="__mceDel">    <p style="font-family:宋体;font-size:25;color:black"></em><% for(char a='A';a<='Z';a++){ out.print(a+"("+(char)(a+32)+")"+" "); } %> <br> </body> </html>

  

 

 

 

 3. 乘法表

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
<%@ 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/> 
    <p style="font-family:宋体;font-size:30;color:black">
    <%
    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-07-03 21:57  欧阳晨  阅读(14)  评论(0编辑  收藏  举报