数组值的编程挑战 [英] Programming Challenge with Array Values

查看:88
本文介绍了数组值的编程挑战的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

I don't know if I am in the correct area to ask this. I am trying to complete a Programming Challenge where the Input box allows the user to enter 10 integers into an array. After you click on the "Display Min and Max" button, the label should display the largest and smallest values stored in the array. Here is my code:

-这时它将执行所有操作,并且如果我输入的最大数字是"99",它将说"99是最小值".如何获得识别大小的信息,然后显示正确的消息?我不知道.

-All it will do at this point is run, and if the largest number i put in is "99", it will say "99 is the smallest value". How can I get it to recognize small and large, and then display the correct message? I can't figure it out. 

推荐答案

您的测试是错误的方法.
      ;     如果intValues(intCount)>然后intSmallest
                intSmallest = intValues(intCount)
           如果结束

Your test is the wrong way around.
            If intValues(intCount) > intSmallest Then
                intSmallest = intValues(intCount)
            End If

如果当前值比当前最小值小 ,则要选择当前值.

You want to select the current value if it is smaller than the current smallest.


这篇关于数组值的编程挑战的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆