import java.io.*; import javax.servlet.*; import javax.servlet.http.*; public class KorrutustabeliServlet extends HttpServlet { protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { PrintWriter out = resp.getWriter(); //out.println(""); out.println("

Korrutustabel!

"); //kuva 10x10 korrutustabel int ridadearv=10; int veergudearv=10; try{ ridadearv=Integer.parseInt(req.getParameter("ridu")); veergudearv=Integer.parseInt(req.getParameter("veerge")); } catch(Exception ex){ out.println(ex.getMessage());} out.println(""); for(int rida=1; rida<=ridadearv; rida++){ out.println(""); for(int veerg=1; veerg<=veergudearv; veerg++){ out.print(""); } out.println(""); } out.println("
"+rida*veerg+"
"); //out.println(""); } }