zoukankan      html  css  js  c++  java
  • 第二次作业

      package s004;
      import java.util.*;//用于java输入语句的包。
     
      public class A
      {
          private static Scanner a;
         
          public static void main(String[]args)
          {  
              int[] a={-2574,-4010,8243,771,2447,-5197,2556,8044,3314,3617,6065,-2817,3131,6318,2186,-113,629,-2582,-37,-1520,164,2055,-5936,5912,1717,5988,4781,5757,892,-4394,8034,2213,-1080,-2080,5364,106,2657,566,3940,-5116};
              int sum=0;
           
            Scanner a = new Scanner(System.in) ;//定义对数组元素从其中的一个元素项开始到另一个元素项结束,所以这里用到Scanner类的nextInt()方法。
             System.out.println("input:");
             int input = a.nextInt() ;
             System.out.println("output:");
             int output =a.nextInt();
          
             for(int i=input;i<=output;i++)
             
             
             System.out.println(sum+=a[i]); 
          }
          
       }

  • 相关阅读:
    layui多选框
    js获取html5 audio 音频时长方法
    危害程序员职业生涯的三大观念
    选择器
    C++ STL partial_sort
    C++ STL sort
    C++ STL 排列 next_permutation prev_permutation
    C++ STL 逆转旋转 reverse reverse_copy rotate
    C++ unique
    C++ remove remove_if erase
  • 原文地址:https://www.cnblogs.com/yuanlp1369/p/4830002.html
Copyright © 2011-2022 走看看