hdu1065

参考:

http://acm.hdu.edu.cn/discuss/problem/post/reply.php?postid=12633&messageid=1&deep=0

http://acm.hdu.edu.cn/discuss/problem/post/reply.php?postid=24925&messageid=1&deep=0

话说这种题存在的意义是为了证明运气这回事吗?(做这道题的我存在的意义是证明有的人运气真的不好吗?)除了PI取的位数以外,其他没什么问题。

#include<stdio.h>
#include<string.h>
#include<math.h>
#include<iostream>
using namespace std;
#define PI 3.141592//关键是这里,必须是3.1415926,位数多了,少了都不行

int main(){
    int t;
    double tempx,tempy;
    double r,area;
    long long int ans;

    scanf("%d",&t);
    for(int cas=1;cas<=t;cas++){
        scanf("%lf%lf",&tempx,&tempy);
        r=sqrt(tempx*tempx+tempy*tempy);//反正后面要平方,所以这里可以不开方,不过这不是wr的关键
        area=PI*r*r/2;
        ans=(int)(area/50.0)+1;

        printf("Property %d: This property will begin eroding in year %d.\n",cas,ans);
    }
    printf("END OF OUTPUT.\n");

    return 0;
}



转载于:https://www.cnblogs.com/ahahah/p/4918190.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值