即時通訊如此混亂,我知道這個程序根本不對,知道熱修復它..格式'%f'需要類型'float *'的參數,但參數2的類型爲'float(*)[(((sizetype)
#include <stdio.h>
int main()
{
int distance;
float avg_speed;
printf ("Enter the race distance (m): ");
scanf ("%d", &distance);
int Num_lanes;
printf ("Enter number of lanes in use:");
scanf ("%d", &Num_lanes);
float Finish_times[Num_lanes];
int i;
for (i = 0; i < Num_lanes; i++)
{
printf ("Enter finish time for lane %d (sec): ", i + 1);
scanf ("%f", &(Finish_times));
}
int Worst_time = 0;
for (i = 0; i < Num_lanes; i++)
{
if (Finish_times[i] < Worst_time)
{
Worst_time = Finish_times[i];
}
}
avg_speed = (distance/1000)/(Worst_time/3600);
printf ("Lane wins in %d seconds, with an average speed of %f km/h",
Worst_time, avg_speed);
return 0
}
如果有人可以請指導我一點上有些失誤,所以我可以改進,我將感謝
'&(Finish_times)' - >'&Finish_times [i]' – BLUEPIXY
'Finish_times [i]
BLUEPIXY
'1000' - >'1000.','3600' - >'3600.' – BLUEPIXY