2021-01-04(1-3)

第一天

1. 基本操作题

题目

public class Java_1 {
    public static void main(String[] args) {
        //*********Found********
        int []f=____________[10];
        f[0]=f[1]=1;
        //*********Found********
        for (________________;i<10;i++)
            f[i]=f[i-1]+f[i-2];
        //*********Found********
        for (int i=0;i<f._____________;i++)
        //*********Found********
            System.out.print(_________________+"  ");
    }
    
}

答案

2. 简单应用题
题目

public class Java_2{
   public static void main(String[] args){
      //*********Found**********
      int ____________ aMatrix = new int[4][];
      int i = 0;
      int j = 0;
      int k = 4;

      for(i = 0; i < 4; i++){
         //*********Found**********
         aMatrix[i] = new int[__________];
 
         //*********Found**********
         for (j = 0; j < ___________.length; j++) {
            aMatrix[i][j] = i+1;
            System.out.print(aMatrix[i][j] + " ");
         }
         //*********Found**********
         System.out.______________________;
      }
   }
}

答案

3. 简单应用题
题目

//打印无符号整数位
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;

public class Java_3 extends JFrame {
   public Java_3(){
      super( "打印无符号整数位" );
      Container c = getContentPane();
      c.setLayout( new FlowLayout() );
      c.add( new JLabel( "请输入整数: " ) );
      final JTextField output = new JTextField( 33 );
      JTextField input = new JTextField( 10 );
      input.addActionListener(
         new ActionListener() {
            //*********Found********
            public void _________________( ActionEvent e ){
               int val = Integer.parseInt(
                  e.getActionCommand() );
               //*********Found********
               _________________.setText( getBits( val ) );
            }
         }
      );
      c.add( input );
      c.add( new JLabel( "该数的二进制位表示是" ) );      
      output.setEditable( false );
     //*********Found********
      c.add( _________________ );
      setSize( 720, 70 );
      setVisible(true);
   }

   private String getBits( int value ){
      int displayMask = 1 << 31;
      StringBuffer buf = new StringBuffer( 35 );
      for ( int c = 1; c <= 32; c++ ) {
         buf.append(
            ( value & displayMask ) == 0 ? '0' : '1' );
         value <<= 1;
         if ( c % 8 == 0 )
            buf.append( ' ' );
      }
      return buf.toString();
   }

   public static void main( String args[] ){
      Java_3 app = new Java_3();
      app.addWindowListener(
         new WindowAdapter() {
     //*********Found********
            public void windowClosing( ___________ e ){
               System.exit( 0 );
            }
         }
      );
   }
}

答案

为了凑字数为了凑字数为了凑字数为了凑字数为了凑字数为了凑字数为了凑字数为了凑字数为了凑字数为了凑字数为了凑字数为了凑字数为了凑字数为了凑字数为了凑字数为了凑字数为了凑字数为

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • 2021年第一天开市,新年新气象,希望在新年投资顺利,完成预定的投资收益,预祝今天开门大吉。 202...
    半瞎子杂谈阅读 151评论 0 2
  • 2021国考面试春节前面试吗 国考笔试结束一个多月了,12月已经过去了,我们迎来新的2021年,也同时意味着笔试成...
    asce123阅读 139评论 0 0
  • 关于「1. 是否运营过公号 2. 现在新开公号年底赚10w如何做 ?」 1.2017年开通运营自的己公众号,自称阁...
    阁主的叨叨阅读 252评论 0 0
  • 第一章 叮叮叮~~ 啊~今天是开学的第一天我得好好打扮打扮,可不能像以前那么落魄了,以前的我从开不打扮,黄皮肤...
    辰熙熙阅读 172评论 1 1
  • 久违的晴天,家长会。 家长大会开好到教室时,离放学已经没多少时间了。班主任说已经安排了三个家长分享经验。 放学铃声...
    飘雪儿5阅读 7,573评论 16 22