总结:输出最大值,最小值,可以先排序,再输出就容易点了.不用循环判断.我还没学.但是觉得很好用 package com.aini; import java.util.Arrays; import java.util.Scanner; //求把数组里的元素,输出最大值,最小值,平均值 public class PAI { public static void main(String[] args) { Scanner c = new Scanner(System.in); System.out.p…
array = (1..10).to_a # 方法1 length = array.length length.times do |t| print "#{array[t]} " end puts "\n" # 方法2 length = array.length-1 for i in 0..length do print "#{array[i]} " end puts "\n" # 方法3 for i in array do…