1

#include<stdio.h>
int main()
{
double x,sum=0,ave;
int i;
for(i=0;i<4;i++)
{
scanf("%lf",&x);
sum=sum+x;

}
ave=(sum/4);
printf("sum=%.1lf,ave=%.1lf\n",sum,ave);
return 0;
}

附加题1 2题

2
#include<stdio.h>
#include<math.h>
int main()
{
double x,y;
printf("Enter x(x>=0):\n");
scanf("%lf",&x);
if(x<=50){
y=0.53*x;
}
else if(x>50)
{
y=(0.53+0.05)*x;
}
printf("y=f(%f)=%.2f\n",x,y);
return 0;
}

附加题1 2题

 

相关文章:

  • 2021-07-20
  • 2022-01-26
  • 2021-06-27
  • 2021-11-24
  • 2022-01-29
猜你喜欢
  • 2021-12-27
  • 2022-02-11
相关资源
相似解决方案