#include <iostream>
#include <cmath>
using namespace std;
#define PI 3.1415926535
int main(){
int n=0;
double x=0,y=0;
cin>>n;
for(int i=0;i<n;i++){
cin>>x>>y;
cout<<"Property "<<i+1<<": This property will begin eroding in year "
<< (int)ceil(PI*(x*x+y*y)/100.0) <<"."<<endl;
}
cout << "END OF OUTPUT." << endl;
return 0;
}
1005:I Think I Need a Houseboat
最新推荐文章于 2025-12-15 13:40:30 发布
该C++程序读取用户输入的坐标点(n个),利用数学公式(π*(x²+y²)/100)计算每个点开始侵蚀的年份,并输出结果。程序使用了cmath库进行数学运算,包括平方根和ceil函数来向上取整。
403

被折叠的 条评论
为什么被折叠?



