求高手,C++向量和字符串问题
doublehighest,lowest;lowest=numbers[0];highest=numbers[0];for(intcount=0;count<input;...
double highest, lowest;
lowest = numbers[0];
highest = numbers[0];
for (int count = 0; count < input; ++count)
{
if (numbers[count] > highest)
highest = numbers[count];
}
for (int count = 0; count < input; ++count)
{
if (numbers[count] < lowest)
lowest = numbers[count];
}
我用这2个公式来找最大数和最小数,最大数显示的是正确的,但是最小数永远显示-9.25596e+061
有办法解决吗 展开
lowest = numbers[0];
highest = numbers[0];
for (int count = 0; count < input; ++count)
{
if (numbers[count] > highest)
highest = numbers[count];
}
for (int count = 0; count < input; ++count)
{
if (numbers[count] < lowest)
lowest = numbers[count];
}
我用这2个公式来找最大数和最小数,最大数显示的是正确的,但是最小数永远显示-9.25596e+061
有办法解决吗 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询