仿照前面的代碼寫物資狀態
#ifndef TOOL_H_INCLUDED
#define TOOL_H_INCLUDED
#include <stdio.h>
#include <string.h>
#include "functions.h"
void tool(Member members[]) {
int firstaidkit, lifebuoy, lifelinebag, whistle, electricfan;
printf("Check Tool Status:\n");
printf("First aid kit(0 no problem/1 Need to be replaced/supplemented): ");
scanf("%d", &firstaidkit);
printf("life buoy(0 no problem/1 Need to be replaced/supplemented): ");
scanf("%d", &lifebuoy);
printf("lifeline bag(0 no problem/1 Need to be replaced/supplemented): ");
scanf("%d", &lifelinebag);
printf("whistle(0 no problem/1 Need to be replaced/supplemented): ");
scanf("%d", &whistle);
printf("electric fan(0 no problem/1 Need to be replaced/supplemented): ");
scanf("%d", &electricfan);
FILE *fp;
if ((fp = fopen ("tool.txt", "w")) == NULL) {
printf("Open File ERROR!\n");
}
else{
fprintf(fp, "Tool Status(0 no problem/1 Need to be replaced/supplemented)\nFirst aid kit:%d\nlife buoy:%d\nlifeline bag:%d\nwhistle:%d\nelectric fan:%d\n", firstaidkit, lifebuoy, lifelinebag, whistle, electricfan);
fclose(fp);
}
}
#endif
Learn More →
Learn More →
今日當值救生員 #ifndef DUTYLIFEGUARD_H_INCLUDED #define DUTYLIFEGUARD_H_INCLUDED #include <stdio.h> #include <string.h> #include "functions.h" void dutylifeguard(Member members[]) { int id1, id2, id3, id4, confirm; printf("Hired positions (sorted by number): \n");
Jun 17, 2023因為比起txt文字檔excel表格更容易看,我嘗試換成excel #ifndef HIREPERSON_H_INCLUDED #define HIREPERSON_H_INCLUDED #include <stdio.h> #include <string.h> #include "functions.h" void hirePerson(Member members[]) { int id;
Jun 17, 2023追加在資料寫入文字檔前的確認 #ifndef DUTYLIFEGUARD_H_INCLUDED #define DUTYLIFEGUARD_H_INCLUDED #include <stdio.h> #include <string.h> #include "functions.h" void dutylifeguard(Member members[]) { int id1, id2, id3, id4, confirm;
Jun 17, 2023仿照前面的代碼寫泳池狀態 #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:");
Jun 17, 2023or
By clicking below, you agree to our terms of service.
New to HackMD? Sign up