编写一个简易的学生信息管理软件:
学生信息:学号、姓名、四门课程的成绩;
实现功能:学生信息的录入、修改、查询、删除。
源代码如下:
#include <iostream>
#include <cstring>
using namespace std;
struct student
{
int no;
char name[30];
int math,computer,english,physics;
}stu[100]={0,"0",0,0,0,0};
void setup();
int lookfor(int m);
void edit();
void Delete();
int main()
{
loop:
cout<<"***************************************\n";
cout<<" 请选择服务 \n";
cout<<" 1 - 录入学生信息 \n";
cout<<" 2 - 查找学生信息 \n";
cout<<" 3 - 修改学生信息 \n";
cout<<" 4 - 删除学生信息 \n";
cout<<" 0 - 退出 \n";
cout<<"***************************************\n";
int menu,num,tem;
cin>>menu;
system("cls");
switch (menu)
{
case 1:
{
setup();
system("cls");
goto loop;
break;
}
case 2:
{
cout<<"请输入您想查询的学号:";
cin>>num;
tem=lookfor(num);
if (tem!=-1)
{
- 1
- 2
前往页