码迷,mamicode.com
首页 > 其他好文 > 详细

POJ 1005 I Think I Need a Houseboat

时间:2014-11-17 17:21:31      阅读:189      评论:0      收藏:0      [点我收藏+]

标签:style   blog   io   color   ar   os   sp   for   div   

/*
题意就是由那么一条半圆的湖,面积会以每年50平方英里的速度增大,然后给定一个坐标,求几年后会被淹没
然后稍微乱搞一下,答案就出来了。
*/

#include<iostream> #include<stdio.h> #include<math.h> using namespace std; int main() { int i,n; double pi,x,y,years; cin>>n; pi=acos(-1);//这个是pi的最准确的表达方式 for(int i=0;i<n;i++) { cin>>x>>y; years=pi*(x*x+y*y)/100; printf("Property %d: This property will begin eroding in year %d.\n",i+1,(int)years+1); } printf("END OF OUTPUT.\n"); return 0; }

 

POJ 1005 I Think I Need a Houseboat

标签:style   blog   io   color   ar   os   sp   for   div   

原文地址:http://www.cnblogs.com/qscqesze/p/4103755.html

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