代码拉取完成,页面将自动刷新
#include "main.h"
enum Option
{
EXIT,
FILL,
ANALYSIS,
SEARCH,
READ
};
void menu()
{
printf("\n");
printf("\t\t******************************\n");
printf("\t\t**** 1. 个人填报 *****\n");
printf("\t\t**** 2. 数据统计 *****\n");
printf("\t\t**** 3. 查询学生 *****\n");
printf("\t\t**** 4. 查看填报 *****\n");
printf("\t\t**** 0. 退出系统 *****\n");
printf("\t\t******************************\n");
printf("\n");
}
int main()
{
const char* FileName = "File.csv";
int ChangeFile = 0;
STuNode* plist = InitList();
CT* count = InitCounter();
ReadFile(plist, FileName, count);
int choose = 0;
do {
system("cls");
menu();
printf("请选择功能:> ");
scanf("%d", &choose);
switch (choose)
{
case FILL:
{
system("cls");
char ID[ID_MAX];
printf("\n请输入你的学号:> ");
scanf("%s", ID);
ChangeFile = DataSearchStu(plist, ID, 1);
if (ChangeFile)
{
ChangeFile--;
SaveFile(plist, FileName);
}
system("pause");
break;
}
case ANALYSIS:
{
system("cls");
DataAllIn(plist, count);
system("pause");
break;
}
case READ:
{
system("cls");
ListPrint(plist, count);
system("pause");
break;
}
case SEARCH:
{
system("cls");
char ID[ID_MAX];
printf("请输入查询学号:> ");
scanf("%s", ID);
DataSearchStu(plist, ID, 0);
system("pause");
break;
}
case EXIT:
{
if (ChangeFile)
SaveFile(plist, FileName);
printf("退出完成~!\n");
ListDestory(plist);
free(count);
count = NULL;
system("pause");
}
default:
system("cls");
printf("选择错误, 请重新输入!!\n");
break;
}
} while (choose);
return 0;
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。