我有下面的代码,我唯一能看到它评估的是第 18 行,它是对 printf() 的调用。它不会更进一步。
#include <stdio.h>
#include <stdlib.h>
int main (void) {
int cylNum;
double disp, pi, stroke, radius;
pi = 3.14159;
printf("Welcome to the Engine Displacement Calculator!\n");
cylNum = scanf("Enter number of cylinders (then press enter): \n");
stroke = scanf("Enter stroke: \n");
radius = scanf("Enter radius: \n");
disp = radius * radius * pi * stroke * cylNum;
printf("Displacement is: %f", disp);
getchar();
printf("Press any key to exit!");
return 0;
}