现在的位置: 首页 > 综合 > 正文

hdoj1065简单题

2013年10月13日 ⁄ 综合 ⁄ 共 309字 ⁄ 字号 评论关闭
#include<iostream>
#include<math.h>
#define PI 3.1415926//oj上的数据不太好,只有PI = 3.1415926时才能过。
using namespace std;

int main(){
	int m;
	double x, y;
	cin>>m;
	for(int i = 0; i < m; i++){
		cin>>x>>y;
		double s = PI * (x * x + y * y);
		int count = s / 100 + 1;
		cout<<"Property "<<i + 1<<
			": This property will begin eroding in year "<<count<<"."<<endl;
	}
	cout<<"END OF OUTPUT."<<endl;
}

抱歉!评论已关闭.