JSP第一次作业

1.环境搭建,运行出来一个JSP页面,显式hello

 

 2.英文字母表

<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ page contentType="text/html"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  
  <body>
    <p style="font-family: 黑体;font-size: 36;"></p>
    <br>英文字母表:</br>
   <p style="font-family: 宋体;font-size: 25;color: blue">
   <% char dx;
      char xx;
      for(dx='A';dx<='Z';dx++) {
      xx=(char)(dx+32);
      out.print(dx+"("+xx+")"+"");
      if(dx=='M')
      out.print("<br>");
      }
      %>
     </p>
  </body>
</html>

 

 

 3.99乘法表

<body>
    <p style="font-family: 黑体;font-size: 36;"></p>
    <h1>乘法表</h1>
   <p style="font-family: 宋体;font-size: 25;color: blue">
   <% 
      for(int i=1;i<=9;i++) {
      for(int j=1;j<=i;j++){
      int n=i*j;
      out.print(j+"X"+i+"="+n+"");
      }
      out.print("<br>");
      }
      %>
     </p>
  </body>

 

 

posted @ 2022-03-03 19:45  热血青年小刘  阅读(12)  评论(0编辑  收藏  举报