PKU 1005
2013-12-17 14:10
155 查看
比较简单吧,其实算是数学问题了
// 1005.cpp : 定义控制台应用程序的入口点。 // #include "stdafx.h" #include "stdio.h" #include "iostream" using namespace std; #define pi 3.1415926 int main(int argc, char* argv[]) { int n=0; cin>>n; int year=0; int i=0; int *res =new int ; while (i<n) { float a=0,b=0; cin>>a>>b; double square=pi*(a*a+b*b)/2; double dt=square/50; year=dt; if(square>year*50) //不加也可以AC res[i]=year+1; else res[i]=year; i++; } for (int j=0;j<n;j++) { printf("Property %d: This property will begin eroding in year %d.\n",j+1,res[j]); } printf("END OF OUTPUT.");//忘记加这个结果WA半天,也怪自己 return 0; }
相关文章推荐
- pku acm 1005
- pku 1005 I Think I Need a Houseboat
- pku 1005
- PKU_1005_I Think I Need a Houseboat
- I Think I Need a Houseboat 1005 PKU
- pku 1005 解题报告
- pku acm 1005 解题报告
- PKU 1005 I Think I Need a Houseboat
- PKU 1005 实现与感想
- POJ 1005I Think I Need a Houseboat解题报告——【PKU ACM】
- 北大PKU在线测试1005
- I Think I Need a Houseboat(PKU1005)
- hdu 1005
- pku2351 Colored Sticks
- hdu 1005
- pku-1011-Sticks
- hdu 1005 || zoj 2105 Number Sequence(规律)
- pku 图论题目 转载
- pku 2586 Y2K Accounting Bug 第一周训练——贪心
- pku 2993 第一周训练——模拟