1
package two;
public class one {
public static void main(String[] args) {
// TODO 自动生成的方法存根
int x,y;
for( x=2;x<=100;x++)
{
for(y=2;y<=x/2;y++)
{
if(x%y==0)
break;
}
if (y>x/2)
{
System.out.print(x+" ");
}}}
2
package two;
public class two {
public static void main(String[] args) {
// TODO 自动生成的方法存根
int[][] array= {{1,2,3},{4,5,6},{7,8,9}};
for(int i=0;i<array.length;i++) {
for(int j=0;j<3;j++)
{
System.out.print(array[j][i]+" ");
}
System.out.println();
} }}
3
package two;
public class three extends Three1{
public static void main(String[] args) {
// TODO 自动生成的方法存根
Three1 xf=new Three1();
xf.father();
xf.month();
System.out.println("我喜欢做的是:"+x1+","+x2+","+f1+","+f2);
}}
package two;
public class Three1 {
static String x1,x2,f1,f2;
public void month() {
this.x1="画画";
this.x2="烹饪";
}
public void father() {
this.f1="钓鱼";
this.f2="看书";
}}