没有合适的资源?快使用搜索试试~ 我知道了~
C++学生信息管理系统100.txt
需积分: 9 6 下载量 131 浏览量
2011-12-14
19:41:16
上传
评论
收藏 5KB TXT 举报
温馨提示
试读
10页
C++学生信息管理系统100.txt
资源推荐
资源详情
资源评论
#include <iostream>
using namespace std;
#include <stdlib.h>
double avg=0;//统计总分和加平均分权
const int mathp=4;//数学学分
const int cppp=5;//C++学分
const sum=70;//设置总学分
class Student
{
private:
int num;
char *name;
char *sex;
char *phone;
char *rphone;
double math;
double cpp;
Student* next;
public:
Student()
{next=NULL;}
~Student();
void Push(Student **refhead,int num,char *name,char *sex,char *phone,char *rphone,double math,double cpp);
void Delete(Student *head,int data);
Student* Find(Student* head,int data);
void Display(Student* head);
int Length(Student* head);
void Math(Student* head,int data);
void Update(Student* head,int data);
using namespace std;
#include <stdlib.h>
double avg=0;//统计总分和加平均分权
const int mathp=4;//数学学分
const int cppp=5;//C++学分
const sum=70;//设置总学分
class Student
{
private:
int num;
char *name;
char *sex;
char *phone;
char *rphone;
double math;
double cpp;
Student* next;
public:
Student()
{next=NULL;}
~Student();
void Push(Student **refhead,int num,char *name,char *sex,char *phone,char *rphone,double math,double cpp);
void Delete(Student *head,int data);
Student* Find(Student* head,int data);
void Display(Student* head);
int Length(Student* head);
void Math(Student* head,int data);
void Update(Student* head,int data);
void Insert();
};
Student* head=new Student;//带头结点的头指针
void Student::Push(Student **refhead,int num,char *name,char *sex,char *phone,char *rphone,double math,double cpp)
{
Student* newnode=new Student;//新增加结点
newnode->num=num;
newnode->name=name;
newnode->sex=sex;
newnode->phone=phone;
newnode->rphone=rphone;
newnode->math=math;
newnode->cpp=cpp;
newnode->next=*refhead;
*refhead=newnode;//重置表头
}
//遍历
void Student::Display(Student* head)
{
Student* temp;
temp=head;
if(temp->next==NULL)//判断空表
cout<<"没有学生!";
else
{while(temp!=NULL)//
{
cout<<"学号:"<<temp->num<<"姓名:"<<temp->name<<"性别:"<<temp->sex<<"手机:"<<temp->phone<<"宿舍电话:"<<temp->rphone<<"数学成绩:"<<temp->math<<"C++成绩:"<<temp->cpp<<endl;
temp=temp->next;
}
};
Student* head=new Student;//带头结点的头指针
void Student::Push(Student **refhead,int num,char *name,char *sex,char *phone,char *rphone,double math,double cpp)
{
Student* newnode=new Student;//新增加结点
newnode->num=num;
newnode->name=name;
newnode->sex=sex;
newnode->phone=phone;
newnode->rphone=rphone;
newnode->math=math;
newnode->cpp=cpp;
newnode->next=*refhead;
*refhead=newnode;//重置表头
}
//遍历
void Student::Display(Student* head)
{
Student* temp;
temp=head;
if(temp->next==NULL)//判断空表
cout<<"没有学生!";
else
{while(temp!=NULL)//
{
cout<<"学号:"<<temp->num<<"姓名:"<<temp->name<<"性别:"<<temp->sex<<"手机:"<<temp->phone<<"宿舍电话:"<<temp->rphone<<"数学成绩:"<<temp->math<<"C++成绩:"<<temp->cpp<<endl;
temp=temp->next;
}
剩余9页未读,继续阅读
资源评论
lan2lan123456789
- 粉丝: 0
- 资源: 5
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功