---
# System prepended metadata

title: '泳池狀態:水溫,酸鹼值,餘氯'

---

# 泳池狀態:水溫,酸鹼值,餘氯
仿照前面的代碼寫泳池狀態
```c=
#ifndef POOL_H_INCLUDED
#define POOL_H_INCLUDED
#include <stdio.h>
#include <string.h>


void pool(members) {
    double outpH, inpH, massagepH, outppm, inppm, massageppm, outamtp, outpmtp, inamtp, inpmtp, massageamtp, massagepmtp;
    printf("outdoor pool pH & ppm:");
    scanf("%lf %lf", &outpH, &outppm);
    printf("indoor pool pH & ppm:");
    scanf("%lf %lf", &inpH, &inppm);
    printf("massage pool pH & ppm:");
    scanf("%lf %lf", &massagepH, &massageppm);
    printf("outdoor pool am temperature(¢XC):");
    scanf("%lf", &outamtp);
    printf("outdoor pool pm temperature(¢XC):");
    scanf("%lf", &outpmtp);
    printf("indoor pool am temperature(¢XC):");
    scanf("%lf", &inamtp);
    printf("indoor pool pm temperature(¢XC):");
    scanf("%lf", &inpmtp);
    printf("massage pool am temperature(¢XC):");
    scanf("%lf", &massageamtp);
    printf("massage pool pm temperature(¢XC):");
    scanf("%lf", &massagepmtp);

    FILE *fp;
    if ((fp = fopen ("pool.txt", "w")) == NULL) {
        printf("Open File ERROR!\n");
    }
    else{
        fprintf(fp, "outdoor pool\npH:%.1lf ppm:%.1lf am¢XC:%.1lf pm¢XC:%.1lf\nindoor pool\npH:%.1lf ppm:%.1lf am¢XC:%.1lf pm¢XC:%.1lf\nmassage pool\npH:%.1lf ppm:%.1lf am¢XC:%.1lf pm¢XC:%.1lf\n", outpH, outppm, outamtp, outpmtp, inpH, inppm, inamtp, inpmtp, massagepH, massageppm, massageamtp, massagepmtp);
        fclose(fp);
    }
}

#endif 

```
![](https://hackmd.io/_uploads/BJ0gvCuDn.png)
![](https://hackmd.io/_uploads/ry9GvRuwn.png)
# 困難
之前忘記了泳池的參數大多是浮點數結果跑下去程式一直重跑,改回來就好了