hdu 1065_ceil的使用

来源:互联网 发布:报修系统 源码 编辑:程序博客网 时间:2024/06/08 07:31

http://acm.hdu.edu.cn/showproblem.php?pid=1065

#include <stdio.h>#include <math.h> const double PI = 3.1415926;int main(){int t;scanf("%d",&t);for(int i = 1; i <= t; i++){double x, y;scanf("%lf%lf",&x,&y);double d = x * x + y * y ;double s = 0.5 * PI * d;int year = ceil(s / 50.0);//返回大于或者等于指定表达式的最小整数printf("Property %d: This property will begin eroding in year %d.\n", i, year);if(i == t)printf("END OF OUTPUT.\n");}return 0;}


0 0
原创粉丝点击