1.52 数据类型与输入格式 练习

1.52 练习

> 在C99中,double的输入必须用%lf,输出必须用%f
>
> INF inifinity  无限大
>
> IND indeterminate  未定义

- 题目
![](https://img2020.cnblogs.com/blog/1883993/202103/1883993-20210309211230752-215856359.png)
![](https://img2020.cnblogs.com/blog/1883993/202103/1883993-20210309211236056-595200726.png)

- 代码

``` c
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
int main()
{
    // 在C99中,double的输入必须用%lf,输出必须用%f
    
    
    /*
    printf("%f\n",11111*11111);
    printf("%f\n",sqrt(-10));
    printf("%lf\n",sqrt(-10));
    printf("%d\n",sqrt(-10));
    printf("%lld\n",sqrt(-10));
    printf("%d\n",1.0/0.0);
    printf("%f\n",1.0/0.0);
    printf("%d\n",0.0/0.0);
    printf("%f\n",0.0/0.0);
    */
    //printf("%d\n",1/0);
    //printf("%f\n",1/0);
    //while(1){
  //       int a, b;
    //scanf("%d %d",&a, &b);
    //printf("%d %d\n",a, b);
   // }
    
    //-1.#IND00
    
    
    return 0;
}

  • 结果

posted @ 2021-03-09 10:07  诸葛蛋蛋  阅读(60)  评论(0)    收藏  举报