import java.util.Scanner;
class FunctionTest0511
{
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
System.out.println("请输入数值n");
int n = sc.nextInt();
printNn(n);
}
/*
需求:
1.键盘输入一个数据n,输出nn乘法表
两个确定:
返回值类型:void
参数列表:int n
*/
public static void printNn(int n){
for(int x=1;x<=n;x++){
for (int y=1;y<=x;y++ )
{
System.out.print(y+"*"+x+"="+y*x+"\t");
}
System.out.println("");
}
}
}
|