编译有错,急急急!!!!!高手指导

[复制链接]
查看11 | 回复1 | 2011-6-27 09:13:53 | 显示全部楼层 |阅读模式
#include
#include
class student
{
private:
        char name[20];
        int ID;
        char sex;
        int score[4];

int aver;
        class student *next;
public:

student();
        ~student();
        void creatlinklist(student *);
        void average();
        void print();
};
student::student()
{int i;
        cin>>this->name>>this->ID>>this->sex;
for(i=0;iscore++);
        this->aver=0;
        this->next=NULL;
}
~student()
{
delete this;
}
void student::creatlinklist(student *&head)
{
        this->next=head;
        head->next=this;
}
void student::average()
{

student *p=this;
        int sum,i;
        while(p!=NULL)
        {
                for(sum=0,i=0;iscore+i);
                p->aver=sum/4;
                p=p->next;
        }
}
void student::print()
{

student *p=this;

int i;
        while(p!=NULL)

{
                coutnameIDsexscore+i)next;
        }
}
void main()
{
student *head,*m;
int num,i;
cout>num;
coutcreatlinklist(head);
}
head->average();
head->print();
}

回复

使用道具 举报

千问 | 2011-6-27 09:13:53 | 显示全部楼层
啥错误?你难道不能贴出来?...
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行