Chinaunix首页 | 论坛 | 博客
  • 博客访问: 628344
  • 博文数量: 603
  • 博客积分: 4000
  • 博客等级: 上校
  • 技术积分: 4940
  • 用 户 组: 普通用户
  • 注册时间: 2008-09-17 11:04
文章分类

全部博文(603)

文章存档

2011年(1)

2008年(602)

我的朋友

分类:

2008-09-17 11:11:38

小女子求高手看下这个简单问题错在什么地方

#include "stdafx.h"
#include
#include "iostream.h"
#include
class stu
{

public:

char *name;

private:
char *xh;
float cj[3];
float zf()
{
float zf=0;
for(int i=0;i<3;i++)
zf+=cj[i];
return zf;
}
public:
stu(char *nm,char * _xh,float _cj[3]);

void show();

void yhyz();


};
stu::stu(char *nm,char * _xh,float _cj[3])
{
name=nm;
xh=_xh;
for(int i=0;i<3;i++)
cj[i]=_cj[i];

}


void stu::show()
{
cout< for(int i=0;i<3;i++)
cout< cout<<"总分为:"< }

void stu:: yhyz();
{

char *_xh;

cout<<"学号";
cin>>xh;
if(strcmp(_xh,xh)=0)
cout<<"您已成功登陆";
else
cout<<"错误的用户名或密码";

exit(1);


}

void main()
{ float a[3]={100,100,100};
float b[3]={100,90,95};
float c[3]={90,90,95};
stu zw("zhangwei ","01093232",a);
stu zq("zhangqiang","01093233",b);
stu lk("liuqiang ","01093234",c);

cout< cout<<"请输入姓名和学号"< char *_name;
cout<<"姓名";
loop:
cin>>_name;
if(_name==zw.name)
zw.yhyz();
else
if(_name==zq.name)
zq.yhyz();
else
if(strcmp(_name,lk.name)==0)
lk.yhyz();
else
cout<<"错误的用户名"< goto loop;




cout<<" 姓名 学号 3人本次年度期末考试的成绩为 :"<
zq.show();
lk.show();
zw.show();
getchar();
}




E:\学习\实例\projrcts\lei\lei.cpp(53) : error C2447: missing function header (old-style formal list?)
Error executing cl.exe.



[/B]


--------------------next---------------------

阅读(212) | 评论(0) | 转发(0) |
0

上一篇:«

下一篇:显示可打印版本

给主人留下些什么吧!~~