1<% @pageImport= "Java.text.SimpleDateFormat"%>2<%@ page language= "java" contenttype= "text/html; Charset=utf-8 "3pageencoding= "UTF-8"%>4<%@ pageImport= "Java.util.*"%>5<! DOCTYPE HTML PUBLIC "-//w3c//dtd HTML 4.01 transitional//en" "HTTP://WWW.W3.ORG/TR/HTML4/LOOSE.DTD" >678<meta http-equiv= "Content-type" content= "text/html; Charset=utf-8 ">9<title>insert title here</title>Ten One<body> A<!--connection Generation 99 multiplication table- -<% - //String str= ""; the for(inti=1;i<10;i++) - { - for(intj=1;j<=i;j++) - { + //str+=j+ "*" +i+ "=" +j*i; - //str+= " "; + //System.out.print (j+ "*" +i+ "=" +j*i+ "\ t"); A%><%=j+ "*" +i+ "=" +j*i+ "\ T"%> at<%}%> -<%= "<br>"%> - -<%}%> -<br> -<% inString st= ""; - for(intq=1;q<10;q++) to { + for(intw=1;w<=q;w++) - { thest+=w+ "*" +q+ "=" +w*Q; *st+= " "; $ }Panax Notoginsengst+= "<br>"; - } the%> +<table width= "height=" border= "1" cellpadding= "0" cellspacing= "0" style= "font:9pt;" bordercolor= "#FFFFF" > A<TR><TD height= "align=" Center > 99 Multiplication Table </td></tr> the<TR><TD style= "PADDING:3PT;" ><%=st%></td></tr> +</table> - $<br> $<!--output full time-- -<% -Date date=NewDate (); theSimpleDateFormat sdf=NewSimpleDateFormat ("Yyyy-mm-dd HH:mm:ss"); -String today=Sdf.format (date);Wuyi%> theCurrent time: <%=today%> -<br> Wu<!--calculation 5! - -<% About intS=1; $ for(intk=1;k<=5;k++) - { -s=s*K; - } A%> +The factorial of 5 is: <%=s%> the<br> -<!--output triangles-- $<% for(inta=1;a<=10;a++) the { the for(intd=1;d<=10-a;d++) the{%> the<%= " " %> -<%}%> in<% the for(intf=1;f<=2*a-1;f++) {%> the<%= "*"%> About<%}%> the<%= "<br>"%> the<%}%> the<br> +<% -String z= ""; the for(intx=1;x<=10;x++)Bayi { the for(intC=1;c<=10-x;c++) the { -z+= " "; - } the for(intv=1;v<=2*x-1;v++) the { thez+= "☆"; the } -z+= "<br>"; the } the the%>94<%=z%> the</body> the
Output 99 multiplication table:
Output factorial and current time:
Output triangles:
Java Web Exercises 1