码迷,mamicode.com
首页 > 编程语言 > 详细

1049 I Think I Need a Houseboat ACM题答案 java版

时间:2014-08-23 21:31:51      阅读:288      评论:0      收藏:0      [点我收藏+]

标签:java   for   ar   new   c   acm   print   as   class   

package arithmetic;

import java.util.Scanner;

public class IThinkI1049 {

public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int num = sc .nextInt();
int years = 0;
double pai=3.1416;
double x=0,y=0;

for(int i=0;i<num;i++){
x=sc.nextDouble();
y=sc.nextDouble();
years = (int) Math.ceil(pai*(x*x+y*y)/100);//因为年数为整数,取不小于该小数的最小整数

System.out.println("Property "+(i+1)+": This property will begin eroding in year "+years+"." );
}

System.out.println("END OF OUTPUT.");

}

}

1049 I Think I Need a Houseboat ACM题答案 java版

标签:java   for   ar   new   c   acm   print   as   class   

原文地址:http://www.cnblogs.com/mafang/p/3931727.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!