为什么只显示9*9=81?(已解决)
<%!
String result(){
String s = "";
for(int i = 1;i <= 9 ;i++){
for(int j = 1; j <= i; j++){
s = i + "*" + j + "=" + (i*j) + " ";
}
s += "<br>";
}
return s;
}
%>
<h1>九九乘法表</h1>
<%=result() %>
<%!
String result(){
String s = "";
for(int i = 1;i <= 9 ;i++){
for(int j = 1; j <= i; j++){
s = i + "*" + j + "=" + (i*j) + " ";
}
s += "<br>";
}
return s;
}
%>
<h1>九九乘法表</h1>
<%=result() %>
2018-01-25
举报