17070047 / 17070047/CodeStructureCourse

1707004736李海洋

Đang mở
#99 0 bình luận 0 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
C++
Star
16
Fork
2
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

```c
#include
#include
#include
#define MAXSIZE 100
typedef char datatype;
typedef struct link_node
{
char name[20];
int kahao;
char xibie[20];
}node;
typedef struct{
node vertextnode[MAXSIZE];
int N; //代表人数
}student;
void creat(student *S)
{
int a, n, i,b;
char s[20];
printf("请输入学生借书信息数:");
scanf("%d", &S->N);
getchar();
for (i = 0; i < S->N; i++)
{

printf("输入第%d个数据:\n", i+1);
printf("请输学生姓名:");
scanf("%s",&S->vertextnode[i].name);
getchar();
printf("请输入学生图书卡号:");
scanf("%d",&S->vertextnode[i].kahao);
getchar();
printf("请输入学生所在院系:");
scanf("%s",&S->vertextnode[i].xibie);
getchar();
}
}

void sort(student *S)
{
int i,j;
node p;
for(i=S->N;i>0;i--)
{
for(j=0;jvertextnode[i].kahao>S->vertextnode[i-1].kahao)
{
p=S->vertextnode[i];
S->vertextnode[i]=S->vertextnode[i-1];
S->vertextnode[i-1]=p;
}
}
}
void jians(student *S)
{
int i;
char m[20];
printf("请输入查找院系:");
scanf("%s",&m);

for(i=0;iN;i++)
{
if(strcmp(S->vertextnode[i].xibie,m)==0)
{
printf("-------------\n");
printf("学生姓名%s\n",S->vertextnode[i].name);
printf("学生借书卡号%d\n",S->vertextnode[i].kahao);
printf("学生院系%s\n",S->vertextnode[i].xibie);
printf("-------------\n");
}
}
}
int main()
{
int i=0;
char m[20];
student P;
creat(&P);
system("cls");
printf("---------按卡号大小进行排序-----------");
sort(&P);
for(i=0;i

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Hướng nghiên cứu

The issue contains a C program for managing student book borrowing records, but the problem is not described. The code includes functions to create, sort, and search records. First, understand the expected behavior by reading the repository's README or other issues. Then, compile and run the program to see if it crashes or produces incorrect output. The bug might be in the sorting logic or input handling.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
c
Lĩnh vực
cli
Loại issue
Lỗi
Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Cần làm rõ
Mức phù hợp với người mới
20/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.