zoukankan      html  css  js  c++  java
  • java数组

    package test_1;

    public class test_2 {
    public static void main(String[] args) {
    double[] myList = {1.9, 2.9, 3.4, 3.5};
    for(int i=0;i < myList.length;i++) {
    System.out.println(myList[i]);    //打印每个数组的值
    }
    double total = 0;
    for(int i=0;i < myList.length;i++) {
    total += myList[i];

    }
    System.out.println(total);    //打印数组的和
    double max = myList[0];
    for(int i=0;i < myList.length;i++) {
    if(myList[0] > max) {
    max = myList[i];
    }
    //System.out.println("Max is " + max);
    }System.out.println("Max is " + max);    //打印数组中最大的值
    }
    }

    ******************************人因为有理想、梦想而变得伟大,而真正伟大就是不断努力实现理想、梦想*****************************
  • 相关阅读:
    Minimum Path Sum
    Unique Paths II
    Unique Paths
    Rotate List
    Permutation Sequence
    Merge Intervals
    Jump Game
    Group Anagrams
    Combination Sum II
    评分
  • 原文地址:https://www.cnblogs.com/cloudLi/p/12851134.html
Copyright © 2011-2022 走看看