17070047 / 17070047/CodeStructureCourse
1707004736李海洋
- 主要語言
- C++
- 星號
- 16
- 分支
- 2
- PR 合併指標
- 30 天內沒有已合併 PR
描述
```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
貢獻指南
這個儲存庫沒有索引到貢獻指南
研究方向
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.
由索引模型根據 Issue 內容生成。
評估
- 技術堆疊
- c
- 領域
- cli
- Issue 類型
- 缺陷
- 難度
- 3/5
- 預估耗時
- 1-2 天
- 活躍度
- 停滯
- 描述清晰度
- 需要釐清
- 新手友好度
- 20/100