zoukankan      html  css  js  c++  java
  • JSP页面打印输出,两种方法。out、《%=

    使用out.println()输出:

    <%@ page contentType="text/html;charset=UTF-8"%>  
    <html>  
    <head><title>乘法口诀</title></head>  
    <body>  
        使用out.println()打印乘法口诀:<br/>  
        <%  
            int cols,rows;  //列、行  
            out.println("<table border='1'>");          
            for(cols=1;cols<10;cols++){  
                out.println("<tr>");  
                for(rows=1;rows<=cols;rows++){  
                    out.println("<td>"+cols+"*"+rows+"="+cols*rows+"</td>");  
                }  
                out.println("</tr>");       
            }         
    
            out.println("</table>");  
        %>  
    </body>  
    </html>

    使用<%= %>表达式输出:

    <%@ page contentType="text/html;charset=UTF-8"%>  
    <html>  
    <head><title>乘法口诀</title></head>  
    <body>  
        使用<%=%>表达式打印乘法口诀:<br/>  
        <table border='1'>  
        <%  
            int cols,rows;  //列、行  
            for(cols=1;cols<10;cols++){  
        %>  
            <tr>  
        <%  
                for(rows=1;rows<=cols;rows++){  
        %>  
                    <td><%=cols%>*<%=rows%>=<%=cols*rows%></td>  
        <%  
                }  
        %>                 
            </tr>   
        <%  
            }         
        %>  
        </table>  
    </body>  
    </html> 
  • 相关阅读:
    gems gems gems
    poj 6206 Apple
    lightoj1341唯一分解定理
    lightoj1370欧拉函数
    约瑟夫环lightoj1179
    拓展欧几里得算法
    RMQ算法
    poj1502MPI Maelstrom
    poj1860Currency Exchange
    生成全排列
  • 原文地址:https://www.cnblogs.com/lx06/p/15686266.html
Copyright © 2011-2022 走看看