public class NineTable{
void function(){
int i;
int z;
for(z=1;z<=9;z++){
for(i=1;i<=z;i++){
System.out.print(i+"*"+z+"="+i*z+" ");
}
System.out.println();
}
}
public static void main(String []args){
NineTable n1 = new NineTable();
n1.function();
}
}
Java-实现九九乘法表public class NineTable{ void function(){ int i; int z; for(z=1;z<=9;z++){ for(i=1;i<=z;i++){ System.out.print(i+"*"+z+"="+i*z+" "); } System.out.println(); } } public static void main(String []args){ NineTable n