这个我没去尝试它的功能,所以不是很清楚具体情况,代码我放到这里,感兴趣的就看看,同样需要建一个项目,因为要用到一些学生的信息,需要外界导入。
#include<iostream>
#include<string.h>
#include<stdlib.h>
#include<conio.h>
using namespace std;
void CheckFile();/*检测该程序所用文件是否存在*/
int FirstMenu();/*输出主菜单*/
int SecondMenu(int i);
/*根据主菜单下用户的选择显示相应的菜单,
用i表示用户的选择*/
void Write();/*录入学生成绩*/
void Search();/*查询学生成绩*/
/*用于记录学生的信息,包括学号*/
typedef struct Student
{
char sNumber[9];
char sName[20];
char sSex[3];
int iGrade[4];
} Stu;
int main()
{
int flag=0;
while(flag!=3)/*当flag=3是表示用户选择了退出*/
{
system("cls");
flag=SecondMenu(FirstMenu());
}
}
int FirstMenu()
{
int i; /*记录用户的选择情况*/
/*输出主菜单*/
cout << "*****************************************************" << endl;
cout << "* *" << endl