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;
}
此处需要注意 定义的输入为浮点型就好了