acm1005.txt
来自「北京大学ACM1005题答案。从网上下的」· 文本 代码 · 共 38 行
TXT
38 行
//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.");
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?