你的scanf("%f %f %f",&c,&d,&p);有错我采用cin代码如下,运行你的例子正确#include#include#includeusing std::cin;void main(){
unsigned int n;
long double c,d,p,x,y;
printf("please input c:原始价格 d:折旧率 P:经过y年后的现值 in order\n");
cin>>c>>d>>p;
x=log(1.0-d);
y=log(p/c);
n=int(y/x)... |
|