2007-10-28
pku1005
关键字: ACM
//http://acm.pku.edu.cn/JudgeOnline/
java 代码
- //http://acm.pku.edu.cn/JudgeOnline/
- package com.pku;
- import java.io.*;
- import java.util.*;
- import java.lang.Math;
- public class Pku1005 {
- /**
- * @param args
- */
- double semisquare(double x, double y)
- {
- double length = Math.sqrt(x*x + y*y);
- return Math.PI * length *length/2;
- }
- public static void main(String[] args) {
- // TODO Auto-generated method stub
- Scanner cin = new Scanner(new BufferedInputStream(System.in));
- Pku1005 pku1005 = new Pku1005();
- int n = cin.nextInt();
- double x = 0, y = 0;
- double square = 0.0;
- double temp = 0.0;
- int i = 1;
- while(i <= n)
- {
- x = cin.nextDouble();
- y = cin.nextDouble();
- square = pku1005.semisquare(x, y);
- System.out.println("Property "+ i +": This property will begin eroding in year "+ (int)(square/50+1) +".");
- i++;
- }
- System.out.println("END OF OUTPUT.");
- }
- }
发表评论
- 浏览: 44895 次
- 来自: 厦门

- 详细资料
搜索本博客
最新评论
-
(转)BeanShell快速入门-- ...
我用的是tortoisesvn, 下载所有文件后,把他作为文件导入eclipse ...
-- by fullfocus -
(转)BeanShell快速入门-- ...
请问你是用什么软件解出carrot2的。 解出内容完整么? 我是用tortois ...
-- by ares -
毕业设计6---web网页 ...
shaucle 写道俺当年的毕业设计是自由发挥(关于cluster的),哈哈,反 ...
-- by bibitoo712 -
毕业设计6---web网页 ...
呵呵,大概只一篇毕业论文了
-- by fullfocus -
毕业设计6---web网页 ...
俺当年的毕业设计是自由发挥(关于cluster的),哈哈,反正他们都不懂..
-- by shaucle






评论排行榜