17070047 / 17070047/CodeStructureCourse
1707004736李海洋
- Linguagem predominante
- C++
- Estrelas
- 16
- Forks
- 2
- Métricas de merge de PRs
- Nenhum PR com merge em 30d
Descrição
```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
Guia de contribuição
Nenhum guia de contribuição indexado para este repositório
Direção de pesquisa
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.
Escrita pelo modelo de indexação a partir do texto da issue.
Avaliação
- Stack de tecnologia
- c
- Domínio
- cli
- Tipo de issue
- Bug
- Dificuldade
- 3/5
- Tempo estimado
- 1-2 dias
- Status de atividade
- Estagnada
- Clareza
- Precisa de esclarecimento
- Facilidade para iniciantes
- 20/100