- 最后登录
- 2019-4-18
- 金钱
- 3948
- 注册时间
- 2015-5-8
- 阅读权限
- 90
- 帖子
- 3652
- 精华
- 1
- 积分
- 6263
副教授
  

|
#include <iostream>
using namespace std;
int main()
{
double x, y, z, r;
cout << "please enter the rate of rainfall in inches per hour: ";
cin >> x;
cout << "Please enter the number of minutes the rain shower lasted: ";
cin >> y;
z = y * (1.0 / 60 * x); // 为什么要用1.0 代替1?
r = 12 / z;
cout << "Rate of " << x << " inches per hour for " << y << " minutes." << endl;
cout << "The total rainfall is " << z << " inches or " << r << " feet." << endl;
return 0;
}
|
|