This article is a mirror article of machine translation, please click here to jump to the original article.

View: 17973|Reply: 4

[JavaEE] java prints out the 9 times 9 multiplication mantra jsp page

[Copy link]
Posted on 12/2/2014 4:35:32 PM | | | |



[mw_shl_code=java,true] <%@ page language="java" import="java.util.*" pageEncoding="gb2312"%>
<%
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>
    <base href="<%=basePath%>">
   
    <title>My JSP 'index.jsp' starting page</title>
        <meta http-equiv="pragma" content="no-cache">
        <meta http-equiv="cache-control" content="no-cache">
        <meta http-equiv="expires" content="0">   
        <meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
        <meta http-equiv="description" content="This is my page">
        <!--
        <link rel="stylesheet" type="text/css" href="styles.css">
        -->
  </head>
  
  <body>
    <%for(int i=0; i<9; i++){
            for(int j=0; j<i+1; j++){
                    %>
                    <%out.print((j+1)+"*"+(i+1)+"="+(j+1)*(i+1)); %>
                      
                    <%
            }%>
            <br/>
            <%
    }
     
    %>
  </body>
</html>
[/mw_shl_code]




Previous:Campus Supervisor Recruitment
Next:Process Manager v4, changed the interface, added features!!!
Posted on 12/2/2014 7:23:34 PM |
Supplement

99.JPG (73.25 KB, Number of downloads: 759)

Posted on 12/2/2014 7:25:01 PM |
[mw_shl_code=java,true] <%@ 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>
    <base href="<%=basePath%>">
   
    <title>My 99 multiplication table</title>
        <meta http-equiv="pragma" content="no-cache">
        <meta http-equiv="cache-control" content="no-cache">
        <meta http-equiv="expires" content="0">   
        <meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
        <meta http-equiv="description" content="This is my page">
        <!--
        <link rel="stylesheet" type="text/css" href="styles.css">
        -->
  </head>
  
  <body>
<%
for(int i=1; i<=9; i++){
%>
<br/>
<%
for(int j=1; j<=i; j++){

out.print( i + "*" + j + "=" + i*j +"\n");
}
}
%>



<br/>
  <br/>
  

  <%
    for(int i =1; i<=9; i++){
            for(int j=9; j>=i; j--){
            out.print(i + "*" + (9-(j-i)) + "="+ i*(9-(j-i)) +"\n");
            }
            %>
            <br/>
            <%
    }
     %>



  </body>
</html>
[/mw_shl_code]
 Landlord| Posted on 12/3/2014 1:10:49 PM |

Not bad, learned
Posted on 12/3/2014 2:27:29 PM |

Why do you want to send out the answer, I obviously don't want to read it
Disclaimer:
All software, programming materials or articles published by Code Farmer Network are only for learning and research purposes; The above content shall not be used for commercial or illegal purposes, otherwise, users shall bear all consequences. The information on this site comes from the Internet, and copyright disputes have nothing to do with this site. You must completely delete the above content from your computer within 24 hours of downloading. If you like the program, please support genuine software, purchase registration, and get better genuine services. If there is any infringement, please contact us by email.

Mail To:help@itsvse.com