本题目要求计算下列分段函数f(x)的值:

#include<stdio.h>
int main() {
double x,y;
scanf("%lf",&x);
if(x!=0) {
y=1/x;
} else {
y=0;
}
printf("f(%.1lf) = %.1lf\n",x,y);
return 0;
}

#include<stdio.h>
int main() {
double x,y;
scanf("%lf",&x);
if(x!=0) {
y=1/x;
} else {
y=0;
}
printf("f(%.1lf) = %.1lf\n",x,y);
return 0;
}