在线等答案中

解决方案 »

  1.   

    public static void main(String[] args) {
            for (int i = 1; i <=9; i++) {
                for (int j = 1; j <=i; j++) {
                    System.out.print(j+"*"+i + "=" + (i*j) + " ");            }
                System.out.println();
            }
        }
    是吧??
      

  2.   

    public static void main(String[] args) {
    for(int i=1;i<10;i++){
    for(int j=1;j<=i;j++){
    System.out.print(j+"*"+i+"="+i*j+"  ");
    }
    System.out.println();
    }
    }
      

  3.   

    贴一个JSP版的。<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
        pageEncoding="ISO-8859-1"%>
    <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
    <title>Insert title here</title>
    </head>
    <body>
    <table border="1">
    <c:forEach begin="1" end="9" var="row">
    <tr>
    <c:forEach begin="1" end="${row}" var="col">
    <td>${row }*${col }=${row*col }</td>
    </c:forEach>
    </tr>
    </c:forEach>
    </table>
    </body>
    </html>
      

  4.   

    来个个性点的99乘法表public void getNum(int num) {
    if (num == 1) {
    System.out.println("1*1=1");
    } else {
    for (int i = 1; i <= num; i++) {
    System.out.print(i + "*" + num + "=" + (i * num) + " ");
    }
    System.out.println();
    getNum(num-1);
    }
    }
    一次循环哦