首页 > 代码库 > I Think I Need a Houseboat

I Think I Need a Houseboat

I Think I Need a Houseboat

个人信息:就读于燕大本科软件工程专业 目前大三;

本人博客:google搜索“cqs_2012”即可;

个人爱好:酷爱数据结构和算法,希望将来从事算法工作为人民作出自己的贡献;

编程语言:java ;

编程坏境:Windows 7 专业版 x64;

编程工具:eclipse;

制图工具:office 2010 powerpoint;

硬件信息:7G-3 笔记本;


真言

安安静静,学习学习,思考在思考

题目

百练 1005

思路

题目很简单,注意细节,求面积是半个圆

ac代码

import java.awt.*;import java.awt.event.*;import java.io.*;import java.lang.reflect.Array;import java.net.*;import java.sql.ResultSet;import java.sql.SQLException;import java.util.HashMap;import java.util.Map;import java.util.Scanner;public class Main {		public static void main(String args[])	{		my_1005();	}	static void my_1005()	{		Scanner in = new Scanner(System.in);		int n = in.nextInt();		double[] a = new double[n];		double[] b = new double[n];		int m = 0;		while( m < n )		{			a[m] = in.nextDouble();			b[m] = in.nextDouble();			m++;		}				m = 0;		double area ;		while( m < n )		{			area = Math.PI * (a[m]*a[m] + b[m]*b[m]) /2 ;			System.out.println("Property "+(m+1)+": This property will begin eroding in year "+((int)area/50 + 1)+"."); 			m++;		}		System.out.println("END OF OUTPUT.");	}	}