📜  c++ scanf 总是期望 double 而不是 float - C++ 代码示例

📅  最后修改于: 2022-03-11 14:44:55.494000             🧑  作者: Mango

代码示例1
float max, zz, rate, time, percent;

printf("Please enter the size (in GB): ");
scanf_s("%f", &max);

printf("\nPlease enter how much you have downloaded already (in GB): ");
scanf_s("%f", &zz);

printf("\nPlease enter the downloadrate (in kB/s): ");
scanf_s("%f", &rate);