第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問(wèn)題,去搜搜看,總會(huì)有你想問(wèn)的

JSP無(wú)法打映出九九乘法表

JSP無(wú)法打映出九九乘法表

世有悲苦 2016-09-20 21:10:43
<%@?page?language="java"?import="java.util.*"?contentType="text/html;?charset=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>我的測(cè)試主頁(yè)</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> ??<%! ??String?print(){ ????????????String?s?=?""; ????????????for(int?i=9;i<9;i++) ????????????{ ????????????????for(int?j?=?1;j<i;j++) ????????????????{ ????????????????????????s+=i+"*"+j+"="+(i*j)+"&nbsp;&nbsp;&nbsp;&nbsp;"; ????????????????} ????????????????????s+="<br>"; ????????????} ????????????return?s; ????????} ????????void?pp(JspWriter?out)?throws?Exception ????????{ ????????????for(int?i=9;i<9;i++) ????????????{ ????????????????for(int?j?=?1;j<i;j++) ????????????????{ ????????????????????????out.print(i+"*"+j+"="+(i*j)+"&nbsp;&nbsp;&nbsp;&nbsp;"); ????????????????} ????????????????????out.println("<br>"); ????????????} ???????????? ???????? ????????} ?????%> ????? ?????<h1>九九</h1> ?????<%=print()%> ?????<%?pp(out);?%> ??</body> </html>
查看完整描述

1 回答

?
Mrshoushou

TA貢獻(xiàn)11條經(jīng)驗(yàn) 獲得超5個(gè)贊

根本不需要那么麻煩;

for(var i=1;j<=9;j++){

document.write("<tr>");

for(var j=1;j<=i;j++){

document.write('<td>'+i+'x'+j+'='+(i*j)+'</td>');}

document.write("</tr>");}

直接for循環(huán)嵌套就解決了

查看完整回答
反對(duì) 回復(fù) 2016-09-22
  • 世有悲苦
    世有悲苦
    你這是用Javascript,我問(wèn)的是為什么我的那個(gè)是錯(cuò)的,不是麻不麻煩的問(wèn)題。我想知道為什么我那樣不行
  • 1 回答
  • 0 關(guān)注
  • 1363 瀏覽

相關(guān)問(wèn)題推薦

慕課專欄
更多

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購(gòu)課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)