/**
auther:kevin
date:20110710
function:a multiplication table
Editon:1rt
*/
import java.util.Scanner; //progarm uses class Scanner
public class Jiujiu
{ //main method begins execution of Java application
public static void main(String args[])
{
Jiujiu.show(9);
}//end method main
public static void show(int n){
int m;
for(int i= 1;i <=n;i++)
{
for(int j= 1;j<=i ; j++)
{
m=i*j;
System.out.print(j+"*"+i+"="+m+" ");
}
System.out.println();
}
}//end method show
}//end class Jiujiu
---------------------------------------
/**
auther:kevin
date:20110710
function:a multiplication table,input number from keyboard
*/
import java.util.Scanner; //progarm uses class Scanner
public class Jiujiu2
{ //main method begins execution of Java application
public static void main(String args[])
{
int n;
//create Scanner to obtain input from command window.
Scanner input = new Scanner(System.in);
System.out.print("Please input a number:");
n = input.nextInt();//read number from user
Jiujiu.show(n);
}//end method main
public static void show(int n){
int m;
for(int i= 1;i <=n;i++)
{
for(int j= 1;j<=i ; j++)
{
m=i*j;
System.out.print(j+"*"+i+"="+m+" ");
}
System.out.println();
}
}//end method show
}//end class Jiujiu