📄 funcdeclare.h
字号:
/*-----------------以下是所有的函数声明----------------------*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <conio.h>
#include <malloc.h>
#include <windows.h>
#include <time.h>
#include <process.h>
#define HEADROW 18
#define LINE 80
#define INFOROW 5
#define USERNAME "admin"
#define PASSWD "888888"
#define SNOTOTAL 100
#define COLOR 138
#define TEXTCOLOR 15
#define LEN sizeof(student)
#define MAXSNO_COUNT 100
#define PAGESIZE 2 //打印一页显示几条
//结构体定义
typedef struct student
{
char sno[5];
char name[25];
int age;
float score[5];
struct student *next;
}student;
//获得光标当前位置
void GetXY(int *x,int *y);
//将光标定位到控制台上的某个位置
void SetXY(int xcursor, int ycursor);
//设置输入窗口颜色
void SetTextCorlor(unsigned short int color);
//画一个输入框
void DrawInputFrame(unsigned short color,int xcursor,int ycursor,int len);
//显示当前时间
void GetTime();
//设置文本颜色
void SetCorlor(short int color);
//清屏函数
void ClearScreen(int fromX,int fromY,int tox,int toY);
//清除菜单界面名称,信息提示框内容,菜单项
void CleanMenuInfo();
//菜单验证输入
int IuputValidate(char ch);
//框架头部
void FrameHead(int row,int line);
//信息提示框
void FrameInfo(int row,int line);
//控制定长输入
int input(char str[], int len);
//密码输入转化为“*”,并控制定长输入
void inputpasswd(char str[], int len);
//去除字符串两端的空格
void TrimSpace(char str[]);
//主菜单验证
int MainMenuValidate(char str[],char begin,char menu);
//输入的数字超过10
int InputValidate(char str[],int begin,int to);
//去左空格
void RomoveLeftBlank(char str[]);
//去右边空格
void RomoveRightBlank( char str[]);
//去中间空格
void RomoveMidBlank(char str[]);
// 去除左边的零头
void RemoveLeftZero(char str[]);
/*对输入的成绩判断是否为空,
非法,是否超出范围
返回0正常
返回1有非法字符
返回2超出范围
*/
int CheckScore(char str[],int rang,int to);
/*判断成绩小数点是否超过2位
返回0正常
返回1超过一个小数点
返回2个位数不是0或者5
*/
int Ismoretwo(char str[],char ch1,char ch2);
/*成绩最终验证
*/
int Score(char str[],int scorelen);
//姓名验证
int CheckName(char str[],int namelen);
//年龄验证
int CheckAge(char str[],char from,char to);
//学号自动生成
void MakeSno(char sno[],int xcursor,int ycursor);
//学号自动生成,根据标置数组回收学号
int Make_Sno(char sno[]);
//学号错误信息提示
int SnoErrorTip(char sno[],int xcursor,int ycursor);
//取得学号
void GetSnostring();
//姓名输入错误信息提示
int NameErrorTip(char name[],int xcursor,int ycursor,int flag);
//年龄输入错误信息提示
int AgeErrorTip(char age[],int xcursor,int ycursor);
/*成绩输入错误提示
distange与学号的行偏移
scorename学科的名称
*/
int ScoreErrorTip(char scorename [],char score[],int xcursor,int ycursor,int distance);
//退出或者继续添加选择时候验证
int ChooseCheck(char str[]);
//学生信息继续添加处理
int IsAdd(char choose[],int xcursor,int ycursor);
//提示是否退出系统处理
int IsExit(char choose[],int xcursor,int ycursor);
//错误信息提示
ShowMessge(char str[]);
//清除信息框内容
CleaseMessage();
//无纪录时提示
void NOStuInfoMessage();
//添加记录超过100条后提示
void Over_hundred();
//打印空操作提示
void EmptyMessage();
//打印非法字符提示
void InvalidMessage();
//打印超出范围提示
void ExceedMessage();
//打印页面专用的清除函数
void CleanPrint();
/*打印学生信息属性名称
*/
void PrintStuAttribute(char str[],int distance,int xcursor,int ycursor);
//求总分
float Totalscore(student *p,int num);
//求平均分
float Avgscore(student *p,int num);
//打印学生数据
PrintData(student **temp,int count,int pageno,int totalpage);
//打印
int PrintStu(student **temp,int count,int flag,char title[],int back);
//处理跳转
void GotoPage(student **temp,int count,int flag,int pageno,int totalpage);
//判断是否合法
int CheckSno(char sno[]);
//学号升序
void SnoSortaAsc(student *head,int count);
//学号降序
void SnoSortDesc(student *head,int count);
//总分升序
void ScoreSortAsc(student *head,int count,int flag);
//总分降序
void ScoreSortDesc(student *head,int count,int flag);
//平均分降序
//flag决定是否要打印
void AvgSortDesc(student *head,int count,int flag);
/*-------------------------功能块函数声明-------------------*/
//登录界面
int LoginMenu();
//添加学生记录
int EnterAddStuInfo();
//学生信息排序界面
int SortStuInfo();
//退出系统菜单界面
int QuitSystem();
//查询学生信息界面
int SearchStuInfo();
//统计界面
int StaticStuData(int xcursor);
//主菜单界面
void MainMenu();
/*-----------------函数声明结束-----------------------------*/
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -