按学号查找成绩 #2

Merged
pn8rjlxip merged 1 commits from p2pwza8cv/System:按学号查找成绩 into master 2 years ago

// 函数功能:按学号查找学生成绩并显示查找结果
void SearchbyNum(STU stu[], int n, int m)
{
long number;
int i, j;
printf("Input the number you want to search:");
scanf("%ld", &number);

/* ---------- begain ---------- */

For(i=0;i<n;i++)
If(strcmp(number,stu[i].num)==0)
printf("%ld\t%s\t", stu[i].num, stu[i].name);
for (j=0; j<m; j++)
{printf("%.0f\t", stu[i].score[j]);}
printf("%.0f\t%.0f\n", stu[i].sum, stu[i].aver);
return;
}
}

/* ----------- end ----------- */

printf("\nNot found!\n");
}

// 函数功能:按学号查找学生成绩并显示查找结果 void SearchbyNum(STU stu[], int n, int m) { long number; int i, j; printf("Input the number you want to search:"); scanf("%ld", &number); /* ---------- begain ---------- */ For(i=0;i<n;i++) If(strcmp(number,stu[i].num)==0) printf("%ld\t%s\t", stu[i].num, stu[i].name); for (j=0; j<m; j++) {printf("%.0f\t", stu[i].score[j]);} printf("%.0f\t%.0f\n", stu[i].sum, stu[i].aver); return; } } /* ----------- end ----------- */ printf("\nNot found!\n"); }
p2pwza8cv added 1 commit 2 years ago
pn8rjlxip merged commit f2b00c0161 into master 2 years ago
The pull request has been merged as f2b00c0161.
Sign in to join this conversation.
No reviewers
No Label
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date

No due date set.

Dependencies

No dependencies set.

Reference: pn8rjlxip/System#2
Loading…
There is no content yet.