64,654
社区成员
发帖
与我相关
我的任务
分享
#include<iostream>
#include<fstream>
#include<cmath>
using namespace std;
const double pi=3.1415926;
int main(){
int n;
ifstream in("abc.txt");
in>>n;
double a,b;
for(int i=0;i<n;++i){
in>>a>>b;
double s=0;
int j;
j=(int)floor(pi*(a*a+b*b)/100);
cout<<"Property "<<i+1<<": This property will begin eroding in year "
<<j+1<<"."<<endl;
}
cout<<"END OF OUTPUT."<<endl;
return 0;
}
#include<iostream>
#include<cmath>
using namespace std;
const double pi=3.1415926;
int main(){
int n;
cin>>n;
double a,b;
for(int i=0;i<n;++i){
cin>>a>>b;
double s= pi*(a*a+b*b);
int j=s/100;
cout<<"Property "<<i+1<<": This property will begin eroding in year "
<<j+1<<"."<<endl;
}
cout<<"END OF OUTPUT."<<endl;
system("pause");
return 0;
}