程序设计实训 作业(二) A数组排序问题
发布时间
阅读量:
阅读量
样例输入1
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define N 10
typedef struct Students {
int id;
char name[10];
int math;
int en;
int ch;
}STU;
STU stu[N];
void sortInfo(STU stu[], int n);
void swapInfo(STU *p, STU *q);
int main() {
int n = 10, m = 0, w = 1;
scanf("%d", &n);
if (n>9||n<1) {
printf("Please input 1-9.");
return 0;
}
for (int i = 0; i<n; i++) {
scanf("%d%s%d%d%d", &stu[i].id, &stu[i].name, &stu[i].ma
全部评论 (0)
还没有任何评论哟~
