import java.util.Scanner;//导包
class Demo{ //定义方法
public void print(int n){
for(int i = 1;i<=n;i++){
for(int j = 1;j<=i;j++){
System.out.print(j+"*"+i+"="+j*i+"\t");
}
System.out.println();
}
}
}
class Demo99{ //测试类
public static void main(String[] args) {
System.out.print("请输入一个整数");
Scanner sc=new Scanner(System.in);
int n = sc.nextInt();
Demo a =new Demo();
a.print(n);
} |
|