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);

     }

    }

    四.实验结果

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

  • 相关阅读:
    [HNOI2008] Cards
    loj #136
    a problem
    dp * 3
    STL
    套题1
    luogu 4211
    loj #2319
    loj #2316
    luogu 1144
  • 原文地址:https://www.cnblogs.com/limu/p/5911184.html
Copyright © 2011-2022 走看看