寻找猛禽地区降雨量的最高值和最低值
问题描述:
更新版本。寻找猛禽地区降雨量的最高值和最低值
我已经想出了我以前的问题,但我仍然不确定如何做最后一部分。我不知道如何获取括号内的数字,而不是获取存储在其中的值。数组由12个数字组成,例如我正在寻找可能是20的最高值,并且已经输入到第4个点。我只能弄清楚如何让它显示20,但我想显示4。它有用户输入,所以应显示的数字可能会有所不同,我不确定如何完成此操作。
我只需要显示最高和最低值的数组编号。我不知道我是否使用了错误的数组。
答
所以你有几个问题,但容易修复。这只会修复最高值的图像3。
1)当设置highestValue
你说的最高值等于[一月,amountOfRain。你需要说highestValue <- data[1,2]
。这会指向amountOfRain
。
2.)您需要更改您的Call
或您的变量highestValue
的名称,因为它存在冲突。
给那些尝试,让我知道你得到什么。
我对你指的是哪一段迷茫。 – Matt
对不起,当我发布它看起来不同。第三张照片是它一直阻止我说的,并且说没有找到最高值。 – alice83