17070047 / 17070047/CodeStructureCourse

1707004736李海洋

Offen
#99 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
C++
Sterne
16
Forks
2
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

```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

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Rechercherichtung

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.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
c
Bereich
cli
Issue-Typ
Bug
Schwierigkeit
3/5
Geschätzter Aufwand
1-2 Tage
Aktivitätsstatus
Veraltet
Klarheit
Muss geklärt werden
Anfängerfreundlichkeit
20/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.