从100个数字中查找最小的数字...? [英] Find Smallest number from 100 numbers...?

查看:113
本文介绍了从100个数字中查找最小的数字...?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用vb6从100多个数字中找到最小的数字.

I want to find smallest number from more than 100 numbers using vb6.

推荐答案

对数字进行迭代,并跟踪您拥有的最小数字到目前为止发现.最后,您将拥有最小的.我不了解VB6,但方法相当简单.
Iterate through the numbers, and keep track of the smallest one you''ve found so far. At the end, you''ll have the smallest. I don''t know VB6 but the method is fairly straight forward.


尝试以下代码:

Try this codes:

int lowest = 2147483647;
int[] nums = {4,2,1,74,6,77};
foreach(int num in nums)
{
   if(num < lowest)
   {
      lowest = num;
   }
}



问候,
爱德华



Regards,
Eduard


这篇关于从100个数字中查找最小的数字...?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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