poj 1005 [简单计算]

来源:互联网 发布:中国网络直播平台排名 编辑:程序博客网 时间:2024/06/03 23:38
#include <iostream>#include <cstdio>#include <cstring>#include <cmath>#define BUG puts("here!!!");using namespace std;const double PI = 3.1415926;int ca;double x, y;double calc;int years;int main() {cin >> ca;for(int i = 1; i <= ca; i++) {scanf("%lf%lf", &x, &y);calc = (x*x + y*y) * PI / 2 / 50;years = ceil(calc);printf("Property %d: This property will begin eroding in year %d.\n", i, years);}printf("END OF OUTPUT.\n");return 0;}

原创粉丝点击