17070047 / 17070047/CodeStructureCourse

1707004736李海洋

オープン
#99 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る
主要言語
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

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。