You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

40 lines
973 B

1 year ago
#include "mysyslib.h"
void input(ss*stu){
char tmp[5];
1 year ago
do{
int pst = stu->nums;
1 year ago
printf("Id ");
scanf(" %s",stu->student[pst].id);
1 year ago
printf("\n");
1 year ago
printf("class ");
scanf(" %s",stu->student[pst].class);
1 year ago
printf("\n");
1 year ago
printf("name ");
scanf(" %s",stu->student[pst].name);
1 year ago
printf("\n");
1 year ago
printf("score1 ");
scanf("%lf",&stu->student[pst].score1);
1 year ago
printf("\n");
1 year ago
printf("score2 ");
scanf("%lf",&stu->student[pst].score2);
1 year ago
printf("\n");
1 year ago
printf("score3 ");
scanf("%lf",&stu->student[pst].score3);
1 year ago
printf("\n");
stu->student[pst].score = stu->student[pst].score1 + stu->student[pst].score2 + stu->student[pst].score3;
stu->nums++;
1 year ago
printf("continue?\n");
scanf("%s",tmp);
}while(!strcmp(tmp,"yes"));
return;
1 year ago
}