double cost_factor(int num_of_sections, int num_of_students) {
double cost;
cost = 35 * num_of_sections / num_of_students;
printf("Cost = %.2lf\n", cost);
return cost;
}
无论我为 num_of_sections 和 num_of_students 输入什么,我都会得到 1.00 的返回值。如果我输入 11 (num_of_sections) 和 364 (num_of_students),我得到 1.00,虽然它应该是 1.06。任何人都可以识别他们的错误吗?