From 3959ea64b0aa5d80f0207eb77c8616f9e7877296 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=AB=98=E4=B8=96=E6=B3=A2?= <2783626707@qq.com> Date: Sun, 12 Nov 2023 15:33:01 +0800 Subject: [PATCH] fix:some bugs --- mysyslib.h | 7 ++----- operations.c | 10 +++++----- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/mysyslib.h b/mysyslib.h index 4c7ec14..04adab5 100644 --- a/mysyslib.h +++ b/mysyslib.h @@ -1,6 +1,7 @@ #include #include #include +#include typedef struct{ char *id; @@ -17,11 +18,7 @@ typedef struct{ int nums; }ss; -ss* init(int); -Student* newStudent(); -void stucpy(Student* dest, Student* src); -void stuswp(Student* fi, Student* se); -int mainMenu(ss *stu); +ss* init(int) void ModifyInfo(ss* stu); void getCom(ss*); void Print(Student*); diff --git a/operations.c b/operations.c index 1e7e81d..12c8568 100644 --- a/operations.c +++ b/operations.c @@ -49,9 +49,9 @@ void input(ss*stu){ stu->student[pst].score = stu->student[pst].score1 + stu->student[pst].score2 + stu->student[pst].score3; stu->nums++; - printf("continue?\n"); + printf("continue?(y/n)\n"); scanf("%s",tmp); - }while(!strcmp(tmp,"yes")); + }while(!strcmp(tmp,"y")); return; } @@ -164,11 +164,11 @@ void ModifyInfo(ss *stu) } int class = atoi(min); class++; - itoa(class,min,10); + sprintf(min,"%d",class); } while (strcmp(max, min) >= 0); - printf("continue?\n"); + printf("continue?(y/n)\n"); scanf("%s", tmp); - }while (!strcmp(tmp, "yes")); + }while (!strcmp(tmp, "y")); return; }