物資狀態

仿照前面的代碼寫物資狀態

#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

Image Not Showing Possible Reasons
  • The image was uploaded to a note which you don't have access to
  • The note which the image was originally uploaded to has been deleted
Learn More →

Image Not Showing Possible Reasons
  • The image was uploaded to a note which you don't have access to
  • The note which the image was originally uploaded to has been deleted
Learn More →