zoukankan      html  css  js  c++  java
  • 软件工程-作业

        private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {                                         
            // TODO add your handling code here:
            int integer = Integer.parseInt(Text.getText());
            long startTime=System.currentTimeMillis();
            Factorial factorial = new Factorial();
            String computeresult = factorial.process(integer).toString();
            information.setText(factorial.time(startTime)+'
    '+factorial.countbig(computeresult));
            result.setText(computeresult);
            
            
        }   
    View Code
     1 private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
     2         // TODO add your handling code here:
     3         String input = Text.getText();
     4         if (input.equals("")) {
     5             JOptionPane.showMessageDialog(null, "请输入要计算阶乘的数字");
     6         } 
     7         else{
     8             for(int i=0;i<input.length();i++) {
     9                 if(input.charAt(i)<='9'&&input.charAt(i)>='0');
    10                 else {
    11                     JOptionPane.showMessageDialog(null, "请不要输入乱七八糟的玩意");
    12                     return;
    13                 }
    14             }
    15             int integer = Integer.parseInt(input);
    16 
    17             long startTime = System.currentTimeMillis();
    18             Factorial factorial = new Factorial();
    19             String computeresult = factorial.process(integer).toString();
    20             information.setText(factorial.time(startTime) + '
    ' + factorial.countbig(computeresult));
    21             result.setText(computeresult);
    22         }
    23 
    24     }
    View Code
  • 相关阅读:
    codeforces 616B Dinner with Emma
    codeforces 616A Comparing Two Long Integers
    codeforces 615C Running Track
    codeforces 612C Replace To Make Regular Bracket Sequence
    codeforces 612B HDD is Outdated Technology
    重写父类中的成员属性
    子类继承父类
    访问修饰符
    方法的参数
    实例化类
  • 原文地址:https://www.cnblogs.com/Angfe/p/13725863.html
Copyright © 2011-2022 走看看