p195. 반복문 - for 문
while 문으로 나타내기
구구단 검색창 만들기
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
</head>
<body>
<div align=center>
<table border=1>
<%
String dan1= request.getParameter("dan1");
String dan2= request.getParameter("dan2");
int dan; int end ;
if(dan1==null|| dan1==""||dan2==""){
dan=2;
end=10;
}else{
end= Integer.parseInt(request.getParameter("dan2"))+1;
dan= Integer.parseInt(request.getParameter("dan1"));
}
while(dan<end){
out.print("<tr>");
int i=1;
while(i<10){
%>
<td>
<%=dan %>x<%=i %>=<%=dan*i %>
</td>
<%
i++;
}
dan++;
out.print("</tr>");
}
%>
</table>
<form>
시작<input type= text name=dan1>-
끝<input type= text name=dan2>
<input type=submit value=출력></div>
</form>
</body>
</html>
한 단만 출력하기
p.205 #4
chap7. 내장객체와 영역
import 없이 쓸 수 있는 객체
예) request
'JAVA' 카테고리의 다른 글
[53일차] chap11. 데이터베이스와 jsp 연동 (0) | 2022.08.04 |
---|---|
[53일차] JSP 교재 p.242 ~ (0) | 2022.08.04 |
[51일차]JSP교재 chap4. jsp페이지의 디렉티브 ~ (0) | 2022.08.02 |
[49일차]chap15. p742 HashMap ~ (0) | 2022.07.28 |
[48일차]536페이지 ~ chap15. 컬렉션프레임워크 (0) | 2022.07.27 |