Java实现九九乘法表

public class Demo {

    public static void main(String[] args) {

        //外循环-------行数
        for(int x=1;x<=9;x++) 
        {

             //内循环---------列数
            for(int y=1;y<=x;y++) 
            {
                System.out.print(y+"*"+"x"+"="+x*y+"\t");         //"\t"制表符,目的是九九乘法表好看一点
            }
            System.out.println();
        }
    }
    
}
 

猜你喜欢

转载自blog.csdn.net/qq_40386113/article/details/83536168