diff --git a/a.txt b/a.txt index 9ce8cd7..2afc4e9 100644 --- a/a.txt +++ b/a.txt @@ -1 +1 @@ -114514 Cierra famale 114514 0 \ No newline at end of file +1 1 1 1 0 diff --git a/main.cpp b/main.c similarity index 92% rename from main.cpp rename to main.c index b80bd8e..b477fac 100644 --- a/main.cpp +++ b/main.c @@ -7,19 +7,19 @@ #define N 50 int k = 1, n = 0, m = 0; -typedef struct student { +typedef struct Bank { char no[13];//卡号 char name[10];//姓名 char sex[8];//性别 int balance;//余额 char passwd[20]; -} student, stu[max]; -void fileWrite(int n, stu s); +} bank, ban[max]; +void fileWrite(int n, ban s); void modify() { int j = 0; FILE * fp; if ((fp = fopen("a.txt", "r")) == NULL) return; - stu s; + ban s; while (fscanf(fp, "%s %s %s %s %d ", &s[j].no, &s[j].name, &s[j].sex[j],&s[j].passwd, &s[j].balance) == 5) { j++; } @@ -80,7 +80,7 @@ void insert() { scanf("%d", &n); FILE * fp; if ((fp = fopen("a.txt", "at")) == NULL) return; - stu s; + ban s; for (i = 0; i