小代码

jsp代码 (在上一篇介绍了运行方式) 难点是乱码 a标签怎样写??  算法来自以下博客

blog.csdn.net/rhljiayou/article/details/6910772
 
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gbk" />
<title> wzzx </title>
<head>
<body>
<h3>
<%="http://blog.csdn.net/rhljiayou/article/details/6910772"%>
<h3>
<h3>
<%="http://wzsts.blog.51cto.com/10251779/1770583"%>
<h3>
<A><%=" href=http://blog.csdn.net/rhljiayou/article/details/6910772"%></a>
<h3>

<%="Hello World! test 1"%>
</h3>

<p> shap </p>
   <%
   	for(int i=0;i<5;i++){  	
    %> 
    <%for(int m=0;m<(6-i);m++){ %>
    &nbsp;&nbsp;
     <%} %>
    <%	for(int j=0;j<i*2+1;j++) {%>
    *
     <%} %> 
     <br>
    <%} %> 

<h3>
<%="Hello World! test 2"%>
</h3>

<%for(int i=-2;i<=2;i++){ %>
    <%for(int j=0;j<Math.abs(i);j++) {%>
   	&nbsp;&nbsp;
    <% }%>
    <%for(int m=0;m<((3-Math.abs(i))*2-1);m++){ %>
    *
    <%} %>
    <br>
    <%} %>
<h3> 
 <h3>
<%="Hello World! test 3"%>
</h3>
<%for(int i=-2;i<=2;i++){ %>
    <%for(int j=0;j<(3-Math.abs(i));j++) {%>
   	&nbsp;&nbsp;
    <% }%>
    <%for(int m=0;m<(Math.abs(i)*2+1);m++){ %>
    *
    <%} %>
    <br>
    <%} %>
<h3>
<%="Hello World! test 4"%>
</h3>

 <%for(int i=-2;i<=2;i++){ %>
    <%for(int j=0;j<Math.abs(i);j++) {%>
   	&nbsp;&nbsp;
    <% }%>
    <%for(int m=0;m<((3-Math.abs(i))*2-1);m++){ %>
    *
    <%} %>
    <br>
    <%} %>

<h3>
<%="Hello World! test 5"%>
</h3>

 <% int arr[][]=new int[11][11];%>
   
 <%for(int i=1;i<=10;i++){ %>
    <% arr[i][i]=1; arr[i][1]=1;%>
    <% }%>
    <%for(int m=3;m<11;m++){ %>
    <%for(int n=1;n<11;n++){ %>
    <%arr[m][n] =arr[m-1][n]+arr[m-1][n-1];%>
    <% }%>
     <% }%>
    <% for(int j=1;j<11;j++){%>
     <%for(int o=1;o<11-j;o++){ %>
     &nbsp; &nbsp;
    <%} %>
     <% for(int p=1;p<=j;p++){%>
     <%=arr[j][p]%>    
    <%} %>
     <br>
    <% }%>

<h3>
<%="Hello World! test 6"%>
</h3>
<%
    	for(int i=1;i<10;i++){
    %>
    <p>
    <%for(int j=1;j<=i;j++){ %>
    
     <%=j+"*"+i+"="+(i*j) %>
     
     <%} %>
     </p>
     <%} %>


<h3>
<%="Hello World! test 7"%>
</h3>
 <%for(int i=100; i<1000; i++){ %>
	<%int a = i/100;  %>
	<%int b = i/10%10;  %>
	<%int c = i%10;  %>
	<%if(a*a*a+b*b*b+c*c*c==i) {   %>
    <%=i+" is  	Narcissistic number;   " %>
    <%} %> 
    <%} %> 

<h3>
<%="Hello World! test 8"%>
</h3>
 by 3>2>1:  <br>
<%int hey[]={1,2,3,4,5,6,7,8,9,0};%>frist 1:
<%
for(int a=0;a<hey.length;a++){%>
<%=hey[a] %>&nbsp;&nbsp;
<%}%>
<br>
<%
int tmp = hey[0];
for (int i=0; i < hey.length; i++){
    for (int j=0; j < hey.length - i -1; j++){
        if (hey[j] < hey[j+1]) {
            tmp = hey[j];
            hey[j] = hey[j+1];
            hey[j+1] = tmp;
        }
    }
} 


 %>
  then 2:
 <%
for(int a=0;a<hey.length;a++){%>
<%=hey[a] %>&nbsp;&nbsp;
<%}%>



<h3>
<%="Hello World! test 9"%>
</h3>

 <%for(int i=100;i<10000;i++){ %>
    <% char a[] = (i+"").toCharArray(); %>
    <%char b[] = new char[a.length];  %>
    <%for (int j = 0; j < a.length; j++) {  %>
    <% b[a.length - j - 1] = a[j]; %>
	<%  String x = new String(a);%>
	<% String y = new String(b);%>
	<%if (x.equals(y)) { %>
	<%=i+" is  Palindrome number         " %>
     <br>
    <% %>
	<%} %>
    <%} %>
    <%} %>
</body>
</html>


你可能感兴趣的:(小代码)