计算分段函数:
1/x (x≠0)
0 (x=0)
#include<stdio.h>
main()
{
float x;
printf("please in put x:\n");
scanf("%f",&x);
if(x==0)
printf("%d",0);
if(x!=0)
printf("%.2f",1/x);
}
计算分段函数:
1/x (x≠0)
0 (x=0)
#include<stdio.h>
main()
{
float x;
printf("please in put x:\n");
scanf("%f",&x);
if(x==0)
printf("%d",0);
if(x!=0)
printf("%.2f",1/x);
}