为什么代码仅在我使用 %lf 或 %f 占位符(第二个占位符)时有效,但在我使用 %d 时它打印 0?
#include <stdio.h>
void main()
{
long id;
id = 123456789;
double Hourly;
Hourly = 30;
int HoursAday, daysAweek, Fired, Hired;
HoursAday = 8; daysAweek = 5; Fired = 2021; Hired = 2019;
printf("bob, id: \"%d\" should get %lf", id, (Hourly * HoursAday * daysAweek) * (Fired - Hired));