打印九九乘法口诀

来源:互联网 发布:淘宝网华为mate7手机壳 编辑:程序博客网 时间:2024/04/30 01:27

package com.mianshi;

/**
 * describe: 打印九九乘法口诀
 * create on: 2011-05-25
 * @author sylor.liu
 * @version 1.0
 * @since jdk1.6
 */
public class printKoujue {
 
 public static void printKouJue(){
  for (int i = 1, j = 1; i < 10; i++) {
   System.out.print(i + " * " + j + " = " + i*j + "; ");
   if(i >= j && i < 9){
    j++;
    i = 0;
    System.out.println();
   }
  }
 }

 /**
  * @param args
  */
 public static void main(String[] args) {
  // TODO Auto-generated method stub
  printKoujue.printKouJue();
 }
 
}

原创粉丝点击