2021-09-10

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="看书";
    }}

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值