17070047 / 17070047/CodeStructureCourse
殷吉奎
- 主要言語
- C++
- スター
- 16
- フォーク
- 2
- PR マージ指標
- 30日以内にマージされた PR はありません
説明
```c
#include"stdio.h"
#include"stdlib.h"
#include"string.h"
#define m 20
#define max 100
typedef struct studentnode{
char cardnum[m];
char name[m];
char classnum[m];
char college[m];
}node;
typedef struct{
node r[max+1];
int length;
}table;
void sort(table *tab,int left,int right)
{
int i,j;
if(leftr[0]=tab->r[i];
do
{
while(strcmp(tab->r[j].cardnum,tab->r[0].cardnum)==1&&ir[i]=tab->r[j];
i++;
}
while(strcmp(tab->r[i].cardnum,tab->r[0].cardnum)==-1&&ir[j]=tab->r[i];j--;}
}while(i!=j);
tab->r[i]=tab->r[0];
sort(tab,left,i-1);
sort(tab,i+1,right);
}
}
void creat(table *tab)
{
int i,j,k;
printf("请输入借书数:\n");
scanf("%d",&tab->length);
tab->length++;
getchar();
for(i=1;ilength;i++)
{
printf("请输入卡号:\n");
gets(tab->r[i].cardnum);
printf("请输入名字:\n");
gets(tab->r[i].name);
printf("请输入班号:\n");
gets(tab->r[i].classnum);
printf("请输入系别:\n");
gets(tab->r[i].college);
printf("\n");
}
printf("创建完成\n");
}
void find(table *tab)
{
int i,j;
char object[m];
printf("请输入你要查找的系别:\n");
gets(object);
for(i=1;ilength;i++)
{
if(strcmp(object,tab->r[i].college)==0)
{
puts(tab->r[i].cardnum);
puts(tab->r[i].name);
puts(tab->r[i].classnum);
puts(tab->r[i].college);
printf("\n");
}
}
}
void display(table *tab)
{
int i;
for(i=1;ilength;i++)
{
puts(tab->r[i].cardnum);
puts(tab->r[i].name);
puts(tab->r[i].classnum);
puts(tab->r[i].college);
printf("\n");
}
}
int main()
{
int i;
table *tab;
tab=(table *)malloc(sizeof(table));
creat(tab);
sort(tab,1,tab->length-1);
display(tab);
printf("请输入任意数字进行查询:\n");
while(scanf("%d",&i)!=EOF)
{
getchar();
find(tab);
}
return 0;
}
```
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
調査の方向性
The issue contains a C program for a student record system with sorting and search functions. The problem is not described; the code is pasted without context. To start, examine the repository structure to see if this is a submission or a bug report. Look for related test files or documentation about expected behavior. Determine what 'done' means by checking if the code compiles, runs correctly, or needs integration.
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- c
- 領域
- cli
- issue の種類
- バグ
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 活発さ
- 停滞
- 明瞭さ
- 説明が足りない
- 初心者へのやさしさ
- 20/100