zoukankan      html  css  js  c++  java
  • 参数求和过程

    ---恢复内容开始---

    一.思路

    先输入参数

    然后利用循环读取,并进行强制类型转换

    最后整型求和

    二.流程图

    三.源代码

    public class Add1 {

     public static void main(String[] args) {
      
      // TODO Auto-generated method stub
      int s=0;
      System.out.println("整数个数"+args.length);
      for(String arg:args){
       System.out.println(arg);
       s=s+Integer.parseInt(arg);
      }
      System.out.println(s);

     }

    }

    四.实验结果

    ---恢复内容结束---

  • 相关阅读:
    数学
    数学
    Computer Science
    数学
    Computer Science
    元学习
    数学
    数学
    数学
    数学
  • 原文地址:https://www.cnblogs.com/limu/p/5911184.html
Copyright © 2011-2022 走看看