找回密码
 注册
搜索
热搜: 回贴
  • 前程无忧官网首页 有什么好的平台可以
  • 最新的销售平台 互联网营销的平台有哪
  • 制作网页的基本流程 网页制作和网页设
  • 【帝国CMS】输出带序号的列表(数字排
  • 网站建设公司 三一,中联,极东泵车的
  • 织梦 建站 织梦网站模版后台怎么更改
  • 云服务官网 哪些网站有免费的简历模板
  • 如何建网站要什么条件 建网站要用什么
  • 吉林市移动公司电话 吉林省退休人员网
  • 设计类毕业论文 网站设计与实现毕业论
查看: 1713|回复: 1

帮我看看这程序哪错了

[复制链接]
发表于 2009-11-5 00:58:18 | 显示全部楼层 |阅读模式 IP:江苏扬州
看看这个程序错哪了,谢谢!




#include<iostream.h>
class student
{public:

void scoretotalcount(float s);
static float sum();
static float average();
student*next;
private:
float score;
static float total;
static int count;
};
void student::scoretotalcount(float s)
{score=s;total+=score;count++;}
float student::sum()
{return total;}
float student::average()
{float average=total/count;return average;}
void add(student*&f,student*&r,float s)
{student *p=new student;
p->scoretotalcount(s);
p->next=NULL;
if(f==NULL)
{f=r=p;}
else
{r->next=p;r=r->next;}
void main()
{student * front=NULL;student * rear=NULL;
float s;
int choice;
do
{cout<<"请选择是否继续输入"<<endl;
cout<<"输入1继续,\n输入0结束\n";
cin>>choice;
switch(choice)
{case 1:
{ cout<<"输入成绩:";
cin>>s;
add(front,rear,s);
break;
}
case 0:
{break;}
}
cout<<"总分数是:"<<student::sum()<<endl;
cout<<"平均分是:"<<student::average()<<endl;
}while(choice);

}
发表于 2009-11-5 00:58:19 | 显示全部楼层 IP:江苏扬州
void add(student*&f,student*&r,float s)

因为你这个函数后面少了一个}

排版太乱了
回复

使用道具 举报

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

本版积分规则

QQ|小黑屋|最新主题|手机版|微赢网络技术论坛 ( 苏ICP备08020429号 )

GMT+8, 2024-10-1 09:46 , Processed in 0.200445 second(s), 12 queries , Gzip On, MemCache On.

Powered by Discuz! X3.5

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表