jsp第一周作业

1.搭建环境,建个工程,输出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"%>


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    
  </head>
  
  <body>
     <%
     for(char c='A';c<='Z';c++)
     out.print(c+"("+(char)(c+32)+")"+",");
      %>
  </body>
</html>

 

 3.输出99乘法表

<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>


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

  </head>
  
  <body>
    <%
    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>");
    }
    
     %>
  </body>
</html>

 

posted @ 2022-03-02 11:57  韩世康  阅读(29)  评论(0编辑  收藏  举报