这个是什么错误?
我按c primer上说的写了个计算中奖率的程序,可是编译时出现了问题,我的英文水平一般,也看不懂什么意思,大家帮我看看错哪了,程序如下:# include <iostream>
long double pro(unsigned numbers,unsigned picks);
int main()
{ using namespace std;
double a,b;
cout<<"请输入总数字和可选数字个数\n";
while((cin>>a>>b)&&b<=a)
{cout<<"你的中奖率为:";
cout<<pro(a,b);
cout<<"输入Q以结束输入";
}
cout<<"bye\n";
system("pause");
return 0;
}
long double pro(unsigned numbers,unsigned picks)
{ long double c=1.0;
long double n;
unsigned d;
for(n=numbers,d=picks;d>0;n--,d--)
c=c*n/d;
return c;
}
错误提示如下:
9 C:\Documents and Settings\cface\桌面\新建文件夹\Untitled1.cpp [Warning] passing `double' for converting 1 of `long double pro(unsigned int, unsigned int)'
9 C:\Documents and Settings\cface\桌面\新建文件夹\Untitled1.cpp [Warning] passing `double' for converting 2 of `long double pro(unsigned int, unsigned int)'