随笔-28  评论-51  文章-10  trackbacks-0
//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*+ 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.");
        }

}


posted on 2007-10-28 17:21 fullfocus 阅读(1634) 评论(2)  编辑  收藏

评论:
# re: PKU1005---北大ACM online judge 2007-12-31 10:48 | koky
为什么你这个代码在pku上提交后说是CompileError啊?  回复  更多评论
  
# re: PKU1005---北大ACM online judge[未登录] 2011-07-21 15:27 | xyz
语言是c++么@koky
  回复  更多评论
  

只有注册用户登录后才能发表评论。


网站导航: