c语言编程练习题:7-87 计算分段函数[1]
作者:yunjinqi   类别:    日期:2023-05-31 10:09:38    阅读:131 次   消耗积分:0 分    

image.png

#include <stdio.h>
int main(){
    double r;
    double x1;
    if (scanf("%lf",&x1)!=EOF){
        if (x1==0.0){r=0.0;}
        else{r=1.0/x1;}
        printf("f(%.1lf) = %.1lf",x1,r);
    }else{
        printf("input wrong");
    }
    
    return 0;
}


版权所有,转载本站文章请注明出处:云子量化, http://www.woniunote.com/article/212
上一篇:c语言编程练习题:7-86 整数四则运算
下一篇:c语言编程练习题:7-88 计算分段函数[2]