首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > 编程 >

POJ 1005(追加)

2013-10-16 
POJ 1005(累加)/* * POJ_1005.cpp * *Created on: 2013年10月14日 *Author: Administrator */#include io

POJ 1005(累加)

/* * POJ_1005.cpp * *  Created on: 2013年10月14日 *      Author: Administrator */#include <iostream>#include <cstdio>#include <cmath>using namespace std;const double PI = 3.141592653;int main(){int t;scanf("%d",&t);int counter = 1;while(t--){double x,y;scanf("%lf%lf",&x,&y);double r = sqrt(x*x + y*y);double target = PI*r*r/2;double sum = 0;int years = 0;while(sum < target){sum+=50;years++;}printf("Property %d: This property will begin eroding in year %d.\n",counter++,years);}printf("END OF OUTPUT.\n");return 0 ;}

热点排行