int main() { double vul,d; int sum; int n; while(cin>>vul>>d) { sum=0; n=1; while(vul>d*n) { sum=sum+n+1; vul=vul-d*n; n++; } while(vul>0.001)//此处最小精度得>0.001,不能为while(vul>0) { vul=vul-d; sum++; } cout<<sum<<endl; } return 0; } 盐水的故事 a...
int main() { double vul,d; int sum; int n; while(cin>>vul>>d) { sum=0; n=1; while(vul>d*n) { sum=sum+n+1; vul=vul-d*n; n++; } while(vul>0.001)//此处最小精度得>0.001,不能为while(vul>0) { vul=vul-d; sum++; } cout<<sum<<endl; } return 0; } 盐水的故事 a...