float hours,tax,wage; printf("Please enter your working hours:"); scanf_s("%f\n", &hours);
原因:scanf函数里含有换行符,输入时换行符被回车忽略了,需要再次输入。
scanf的printf的用法不同,实际上输入两个数据,只有第一个起作用,第二个是无效的。
C——为什么scanf需要输入两次
原文:https://www.cnblogs.com/zhengmq2010/p/12335730.html