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.
27 lines
485 B
27 lines
485 B
#define _CRT_SECURE_NO_WARNINGS
|
|
#include<stdio.h>
|
|
struct student {
|
|
char name[10];
|
|
int id;
|
|
};
|
|
struct cllass {
|
|
struct student stu[100];
|
|
int length;
|
|
};
|
|
void insert(struct student* a, struct cllass* b) {
|
|
b->stu[b->length] = *a;
|
|
b->length++;
|
|
}
|
|
int main_seqlist() {
|
|
struct cllass a;
|
|
a.length = 0;
|
|
int num;
|
|
struct student l;
|
|
scanf("%d", &num);
|
|
for (int i = 0; i++; i < num) {
|
|
scanf("%s", l.name);
|
|
scanf("%d", &l.id);
|
|
insert(&l, &a);
|
|
}
|
|
return 0;
|
|
} |