很简单的一道应用题。
显然,小车应该半路回去接走路的那个人。列个方程求解即可。
#include<iostream>
#include<iomanip>
using namespace std;
long double s, a, b;
int main()
{
cin >> s >> a >> b;
cout << fixed << setprecision(6)
<< (a / b + 3) * s / (3 * a + b);
return 0;
}
很简单的一道应用题。
显然,小车应该半路回去接走路的那个人。列个方程求解即可。
#include<iostream>
#include<iomanip>
using namespace std;
long double s, a, b;
int main()
{
cin >> s >> a >> b;
cout << fixed << setprecision(6)
<< (a / b + 3) * s / (3 * a + b);
return 0;
}