任何人都可以帮我处理这段代码吗?我无法弄清楚在compare_all_min ()
and上使用什么参数compare_all_max ()
。我的代码是:
while (count <= 10) {
minimum = getMin ( item [count] );
maximum = getMax ( item [count] );
printf ( "Minimum is %d\n", &min );
pritnf ( "Max: %d\n", &max );
count++;
}
printf ( "Displaying summary:\n" );
least_num = compare_all_min ( ); //what argument do I
greatest_num = compare_all_max ( ); //use on these two?
printf ( "The least number contained by the array is: %d\n", &least_num );
printf ( "The greatest number contained by the array is: %d\n", &greatest_num );
我不知道要使用什么参数,特别是因为 while 循环会打印出 10 个最小数字和 10 个最大数字。注意:基本上,compare_all_min ( )
只需比较将在 while 循环中获得的所有 10 个最小值,然后获得这些值中的最小值,然后compare_all_max ( )
比较所有 10 个最大值,然后获得这些数字中的最大值。非常感谢。