//Hydroelectric Dam Helper
#include <stdio.h>
#define GRAV 9.80
#define EFINC 0.9
#define EFINC2 90
int main()
{
//Defines all the variables to be used
double height, work, mass;
printf("Height of dam (in meters):");
scanf("%lf", &height);
printf("Flow of water (in thousand cubic meters per second):");
scanf("%lf", &mass);
work = (mass * GRAV * height * EFINC);
printf("The dam would produce %f megawatts at %d%% efficency", &work, EFINC2);
return 0;
}
值设置正确,我通过打印高度和质量对其进行了测试,但工作从未收到值,并且 EFINC2 打印出一个我不太确定的荒谬数字