pku1005

//http://acm.pku.edu.cn/JudgeOnline/
java 代码
 
  1. //http://acm.pku.edu.cn/JudgeOnline/  
  2. package com.pku;  
  3. import java.io.*;  
  4. import java.util.*;  
  5. import java.lang.Math;  
  6.   
  7. public class Pku1005 {  
  8.   
  9.         /** 
  10.          * @param args 
  11.          */  
  12.         double semisquare(double x, double y)  
  13.         {  
  14.             double length = Math.sqrt(x*x + y*y);  
  15.             return Math.PI * length *length/2;  
  16.         }  
  17.         public static void main(String[] args) {  
  18.             // TODO Auto-generated method stub  
  19.             Scanner cin = new Scanner(new BufferedInputStream(System.in));  
  20.             Pku1005 pku1005 = new Pku1005();  
  21.             int n = cin.nextInt();  
  22.             double x = 0, y = 0;  
  23.             double square = 0.0;  
  24.             double temp = 0.0;  
  25.             int i = 1;      
  26.             while(i <= n)  
  27.             {  
  28.                 x = cin.nextDouble();  
  29.                 y = cin.nextDouble();  
  30.                 square = pku1005.semisquare(x, y);  
  31.                 System.out.println("Property "+ i +": This property will begin eroding in year "+ (int)(square/50+1) +".");  
  32.                 i++;                      
  33.             }  
  34.             System.out.println("END OF OUTPUT.");  
  35.         }  
  36.   
  37. }  
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值