package test2;
public class xunhuan1026 {
public static void main(String[] args) {
//1*1
//2*1 2*2
for( int i=1;i<=9;i++) {
for(int j=1;j<=i;j++) {
System.out.print(i+"*"+j+"="+i*j+" ");
}
System.out.println(" ");
}
}
}
package test2;
public class sushu1026 {
public static void main(String[] args) {
//定义素数的个数
int num =0;
int number=2;
boolean flag ;
while(num<30) {
flag=true;
for(int i =2 ;i*i<=number;i++) {
//是素数
if(number % i==0) {
flag=false; //不是素数
break;
}
}
if(flag) {
num ++;
if(num%8==0)
System.out.println(number);
else
System.out.print(number+" ");
}
number++;
}
}
}