poj 1005

来源:互联网 发布:wps 邮箱 for ubuntu 编辑:程序博客网 时间:2024/06/05 16:21

poj 1005 水题一道大致题意 输入n个浮点数 ,计算浮点数;

#include<stdio.h>
#define pi 3.1415926
int main()
{
int i,j,n;
double x,y;
scanf("%d",&j);
for(i=1;i<=j;i++)
{
scanf("%lf %lf",&x,&y);
n=pi*(x*x+y*y)/100;
printf("Property %d: This property will begin eroding in year %d.\n",i,n+1); 
}
printf("END OF OUTPUT.\n");
return 0;
}
此处需要注意 定义的输入为浮点型就好了


0 0
原创粉丝点击