#include<stdio.h>
#include<math.h>
#define PI 3.1415926
int main()
{
int N;
scanf("%d", &N);
float a;
float b;
float area;
int Z;
int i;
for (i = 1; i <= N; i++)
{
scanf("%f%f", &a, &b);
area = PI / 2 * (pow(a, 2) + pow(b, 2));
Z = area / 50 + 1;
printf("Property %d: This property will begin eroding in year %d.\n", i, Z);
}
printf("END OF OUTPUT.");
return 0;
}
#include<math.h>
#define PI 3.1415926
int main()
{
int N;
scanf("%d", &N);
float a;
float b;
float area;
int Z;
int i;
for (i = 1; i <= N; i++)
{
scanf("%f%f", &a, &b);
area = PI / 2 * (pow(a, 2) + pow(b, 2));
Z = area / 50 + 1;
printf("Property %d: This property will begin eroding in year %d.\n", i, Z);
}
printf("END OF OUTPUT.");
return 0;
}
本文分享了一段C语言程序代码,该程序用于计算不同房产开始受到侵蚀的年份。程序首先读取房产数量,然后逐个输入每处房产的相关参数,并通过公式计算出各房产开始侵蚀的具体年份。
6549

被折叠的 条评论
为什么被折叠?



