---
title: "pku1005"
author: "fullfocus"
date: "2007-10-28T17:25:58Z"
tags: []
slug: "pku1005"
draft: false
lastmod: "2007-10-28T17:25:58Z"
id: 136161
url: "https://fullfocus.iteye.com/blog/136161"
---

//http://acm.pku.edu.cn/JudgeOnline/

java 代码

 

01. //http://acm.pku.edu.cn/JudgeOnline/
02. package com.pku;
03. import java.io.\*;
04. import java.util.\*;
05. import java.lang.Math;
06. public class Pku1005 {
07. /\**
08. * @param args
09. \*/
10. double semisquare(double x, double y)
11. {
12. double length = Math.sqrt(x\*x + y\*y);
13. return Math.PI * length \*length/2;
14. }
15. public static void main(String\[] args) {
16. // TODO Auto-generated method stub
17. Scanner cin = new Scanner(new BufferedInputStream(System.in));
18. Pku1005 pku1005 = new Pku1005();
19. int n = cin.nextInt();
20. double x = 0, y = 0;
21. double square = 0.0;
22. double temp = 0.0;
23. int i = 1;
24. while(i &lt;= n)
25. {
26. x = cin.nextDouble();
27. y = cin.nextDouble();
28. square = pku1005.semisquare(x, y);
29. System.out.println("Property "+ i +": This property will begin eroding in year "+ (int)(square/50+1) +".");
30. i++;
31. }
32. System.out.println("END OF OUTPUT.");
33. }
34. }