17070047 / 17070047/CodeStructureCourse

孟新宇

オープン
#75 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る
主要言語
C++
スター
16
フォーク
2
PR マージ指標
30日以内にマージされた PR はありません

説明

```c
#include
#include
#include
#define MAXSIZE 100
typedef struct {
int cardNum;
char name[8];
char major[10];
int classNum;
}libCardInfo;
typedef struct{
libCardInfo cardInfo;
}recordInfo;
typedef struct{
recordInfo r[MAXSIZE + 1];
int length;
}table;
void input(table *tab){
char s = 'Y';
tab->length = 1;
while (s == 'Y' || s == 'y'&&tab->length <= MAXSIZE){
printf("\n请输入借书证卡号:");
scanf("%d", &tab->r[tab->length].cardInfo.cardNum);
printf("请输入持卡人姓名:");
scanf("%s", tab->r[tab->length].cardInfo.name);
printf("请输入持卡人系别:");
scanf("%s", tab->r[tab->length].cardInfo.major);
printf("请输入持卡人班号:");
scanf("%d", &tab->r[tab->length].cardInfo.classNum);
printf("请问是否继续录入?(Y/N):");
getchar();
scanf("%c", &s);
tab->length++;
}
}
void output(libCardInfo *info){
printf("\t************************\n");
printf("\t 借书证卡号:%d\n", info->cardNum);
printf("\t 持卡人姓名:%s\n", info->name);
printf("\t 持卡人系别:%s\n", info->major);
printf("\t 持卡人班号:%d\n", info->classNum);
printf("\t************************\n");
}
void shellinsertsort(table *tab){
int i, j, d;
d = tab->length / 2;
while (d >= 1){
for (i = d + 1; ilength; i++){
tab->r[0] = tab->r[i];
j = i - d;
while (j>0 && tab->r[0].cardInfo.cardNumr[j].cardInfo.cardNum){
tab->r[j + d] = tab->r[j];
j = j - d;
}
tab->r[j + d] = tab->r[0];
}
d = d / 2;
}
for (i = 1; ilength; i++){
output(&tab->r[i].cardInfo);
}
}
void seqSearch(table *tab){
int i = 1, j = 1;
char major[10];
printf("\n请输入你要查找的系名:");
scanf("%s", major);
while (ilength){
if (!strcmp(tab->r[i].cardInfo.major, major)){
output(&(tab->r[i].cardInfo));
j = 0;
}
i++;
}
if (j) printf("\t\t 『没有该系别的记录!』\n");
}

int main() {
int x, set = 1;
table tab;
while (set){
printf("\t\t******************************\n");
printf("\t\t** **\n");
printf("\t\t** 欢迎使用借书证管理系统 **\n");
printf("\t\t** **\n");
printf("\t\t******************************\n");
printf("\t\t** 1.录入借书证基本信息 **\n");
printf("\t\t** **\n");
printf("\t\t** 2.输出已有借书证信息 **\n");
printf("\t\t** **\n");
printf("\t\t** 3.系名查找借书证信息 **\n");
printf("\t\t** **\n");
printf("\t\t** 4.退出借书证管理系统 **\n");
printf("\t\t******************************\n\n");
printf("请按你的需求选择操作:");
scanf("%d", &x);
switch (x){
case 1:input(&tab); break;
case 2:shellinsertsort(&tab); break;
case 3:seqSearch(&tab); break;
case 4:set = 0; printf("\t\t\t『系统退出成功!』\n"); break;
default: printf("没有该选项对应的操作!");
}
system("pause");
system("cls");
}
```
![1](https://user-images.githubusercontent.com/45328144/49652780-014d7480-fa6e-11e8-8176-20600b20ec0f.png)
![2](https://user-images.githubusercontent.com/45328144/49652822-1b875280-fa6e-11e8-8aa5-5f85002ca1c5.png)

![3](https://user-images.githubusercontent.com/45328144/49652776-00b4de00-fa6e-11e8-9e8e-7d6998a8d95f.png)
![4](https://user-images.githubusercontent.com/45328144/49652779-00b4de00-fa6e-11e8-9abb-eb92ece7f0c8.png)

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

調査の方向性

The issue contains a full C program for a library card management system with screenshots, but no description of what the bug or requested change is. A newcomer would need to examine the code and images to infer the problem, likely related to the shell sort, input handling, or output formatting. Start by running the program to see its current behavior, then compare against the expected behavior implied by the screenshots.

索引モデルが issue の本文から書いたものです。

評価

技術スタック
c
領域
cli
issue の種類
バグ
難易度
3/5
見積もり時間
1〜2日
活発さ
停滞
明瞭さ
説明が足りない
初心者へのやさしさ
25/100

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

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