fix:some bugs

main
高世波 1 year ago
parent 7295cf1158
commit 3959ea64b0

@ -1,6 +1,7 @@
#include<stdio.h> #include<stdio.h>
#include<stdlib.h> #include<stdlib.h>
#include<string.h> #include<string.h>
#include<stdlib.h>
typedef struct{ typedef struct{
char *id; char *id;
@ -17,11 +18,7 @@ typedef struct{
int nums; int nums;
}ss; }ss;
ss* init(int); ss* init(int)
Student* newStudent();
void stucpy(Student* dest, Student* src);
void stuswp(Student* fi, Student* se);
int mainMenu(ss *stu);
void ModifyInfo(ss* stu); void ModifyInfo(ss* stu);
void getCom(ss*); void getCom(ss*);
void Print(Student*); void Print(Student*);

@ -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->student[pst].score = stu->student[pst].score1 + stu->student[pst].score2 + stu->student[pst].score3;
stu->nums++; stu->nums++;
printf("continue?\n"); printf("continue?(y/n)\n");
scanf("%s",tmp); scanf("%s",tmp);
}while(!strcmp(tmp,"yes")); }while(!strcmp(tmp,"y"));
return; return;
} }
@ -164,11 +164,11 @@ void ModifyInfo(ss *stu)
} }
int class = atoi(min); int class = atoi(min);
class++; class++;
itoa(class,min,10); sprintf(min,"%d",class);
} while (strcmp(max, min) >= 0); } while (strcmp(max, min) >= 0);
printf("continue?\n"); printf("continue?(y/n)\n");
scanf("%s", tmp); scanf("%s", tmp);
}while (!strcmp(tmp, "yes")); }while (!strcmp(tmp, "y"));
return; return;
} }

Loading…
Cancel
Save