编译的时候没问题,但是运行的时候有错误
#include <stdio.h>int main (void)
{
const double unit_price = 3.50 ;
int quantity = 0 ;
printf("Enter the number that you want to buy :");
sanf("%d",&quantity);
if(quantity >10)
printf("The price for %d is $%.2f\n",quantity,quantity*unit_price*0.95);
else
printf("The price for %d is $%.2f\n",quantity,quantity*unit_price);
return 0;
}
Linking...
if1.obj : error LNK2001: unresolved external symbol _sanf
Debug/if.exe : fatal error LNK1120: 1 unresolved externals
执行 link.exe 时出错.