ZOJ 1049 I Think I Need a Houseboat

来源:互联网 发布:oracle 数据挖掘 编辑:程序博客网 时间:2024/05/20 07:17

这是一道基本题,需要注意的是This property...这句话前面需要输出一个空格,否则会提示“Wrong Answer”

C++代码:

#include<stdio.h>#include<math.h>#define PI 3.1415927int main(){int n,year;double x,y,r,S;scanf("%d",&n);for(int i=1;i<=n;i++){scanf("%lf%lf",&x,&y);r=x*x+y*y;S=PI*r;year=(int)ceil(S/100.0f);printf("Property %d:",i);printf(" This property will begin eroding in year %d.\n",year);}printf("END OF OUTPUT.\n");return 0;}


原创粉丝点击