| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 632 人关注过本帖
标题:那位大哥帮我改错!!!!
只看楼主 加入收藏
fanxuechao
Rank: 2
来 自:新疆
等 级:论坛游民
帖 子:19
专家分:27
注 册:2010-6-9
结帖率:50%
收藏
已结贴  问题点数:10 回复次数:9 
那位大哥帮我改错!!!!
本人初学,最近在作课程设计,题目是学生信息管理系统
那位大哥帮小弟找一下错误。非常感谢!!!!!
下面是源程序代码:

// fei123.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <iostream>
#include <string>
#include<fstream>  
#include<iomanip>
using namespace std;
int amount=0;           //记录学生个数
ofstream *file[50];
/////////////////////////////////*学生成绩结构体*////////////////////////////////////////
struct score
{
 float yw;
 float sx;
 float yy;
 float wl;
 float hx;
 float sw;
 struct score *next;
}
/////////////////////////////////*学生数据类*////////////////////////////////////////
class student   
{
public:
 string mun;
 string name;
    score sc1;
 score sc2;
 score sc3;//平时成绩,期末成绩,总成绩;
 class student *next;
}
/////////////////////////////////*函数声明*////////////////////////////////////////
void input(student *head);          //录入
void search1(student *head);        //姓名查询
void search2(student *head);        //学号查询
void change(student *head);         //修改
void shanchu(student *head);        //删除
void get(student *head);            //取数据
void display();                     //显示菜单
void show(student *head);           //显示数据
void readin(student *head);         //保存数据
void chushihua(student *head);      //初始化
/////////////////////////////////*主函数*////////////////////////////////////////
void main() //主函数
{
 system("color f0");
 char x;
 bool flag2=0;
    student *head=new student;               //初始化学生数据
 head->next=NULL;
    cout<<"                        ★ 欢迎使用学生信息管理系统 ★        \n ";
 display();                               //显示菜单
 do
 {
  do
  {
   cin>>x;
   if((x>='0'&&x<='8'))
    flag2=1;
   else
   {
    cout<<"指令错误!!!!!!!!!!"<<endl;
                cout<<" 请选择相应的数字进行操作: ";
   }
  }while(flag2==0);
  switch(x)
  {
  case '0':cout<<"******************************现在进行学生信息录入******************************\n";
   input(head);
   cout<<"输入的学生信息为:\n";
   show(head);
   cout<<"********************************************************************************\n";
   display(); break;
  case '1':
   {
    char z;
                cout<<"******************************现在进行学生信息查询******************************\n";
                cout<<"请选择查询方式:";
    cout<<"(0).姓名查询;(1).学号查询:";  cin>>z;
    while(z!='0'&&z!='1')
    {
     cout<<"指令错误<请选择(0)或者(1)!>!!!!!!!"<<endl;
                    cout<<"请选择查询方式:(0).姓名查询;(1).学号查询:"; cin>>z;      
    }  
    switch(z)
    {
    case '0': search1(head);break;//按姓名查询
    case '1': search2(head);break;//按学号查询
    }   
    cout<<"********************************************************************************\n";
    display();
    break;
   }
  case '2': cout<<"******************************现在进行学生信息修改******************************\n";
   change(head);
   cout<<"********************************************************************************\n";
   display(); break;                //按姓名修改
  case '3': cout<<"******************************现在进行学生信息删除******************************\n";
   shanchu(head);
            show(head);
   cout<<"********************************************************************************\n";
   display();  
   break;                           //删除
  case '4': cout<<"******************************现在进行显示学生信息******************************\n";
   show(head);
   cout<<"********************************************************************************\n";
   display();
   break;                           //显示数据
  case '5':cout<<"******************************现在进行初始化学生信息****************************\n";
   chushihua(head);
   cout<<"********************************************************************************\n";
   display() ;
   break;
  case '6':cout<<"******************************现在进行提取学生信息******************************\n";
   get(head);
   cout<<"********************************************************************************\n";
   display();  break;
  case '7':cout<<"******************************现在进行保存学生信息******************************\n";
   readin(head);
   cout<<"********************************************************************************\n";
   display();
   break;
  case '8':
   cout<<"********************************************************************************\n";
   cout<<"               ¤  您已退出学生信息管理系统, 谢谢您的使用!  ¤                  \n";           
   cout<<"********************************************************************************\n";
   cout<<endl;
   exit(0);
   break;
  }
 }while(flag2==1);
}
/////////////////////////////////*显示菜单*////////////////////////////////////////
void display()   
{  
 cout<<"            ++++++++++**********++++++++++**********++++++++++\n";
 cout<<"            $                                             $\n";
 cout<<"           $                     ^^^^^^^^^^                     $\n";   
 cout<<"          $          请选择:                                     $\n";
 cout<<"          $     [0]-录入;        [1]-查询;        [2]-修改;      $\n";
 cout<<"           $    [3]-删除;        [4]-显示;        [5]-初始化;   $\n";
 cout<<"            $   [6]-提取;        [7]-保存;        [8]-退出;    $\n";
 cout<<"             **********++++++++++**********++++++++++**********\n";
 cout<<" 请选择相应的数字进行操作: ";
}
/////////////////////////////////*初始化学生数据*////////////////////////////////////////
void chushihua(student *head)
{
 int j=0;char c;
 cout<<"注意:初始化操作将删除<总评成绩.txt>文件中的所有信息!!!!!!\n";
 cout<<"是否继续操作?(y/n):";cin>>c;
 if (c='y')
 {   
        amount=1;
  file[j]=new ofstream("F:\\课设\\总评成绩.txt",ios::out);
 }
 cout<<"......成功清除<总评成绩.txt>的信息\n ";
}
/////////////////////////////////*显示学生数据*////////////////////////////////////////
void show(student *head)
{
 student *stu=head;
 cout<<"|    学号   |   姓名   |  语文  |  数学  |  英语  |  物理  |  化学  |  生物  |"<<endl;
 while(stu->next!=NULL)
 {
  (*stu).sc3.yw=((*stu).sc1.yw)*0.30+((*stu).sc2.yw)*0.70;//总成绩计算
  (*stu).sc3.sx=((*stu).sc1.sx)*0.30+((*stu).sc2.sx)*0.70;
  (*stu).sc3.yy=((*stu).sc1.yy)*0.30+((*stu).sc2.yy)*0.70;
  (*stu).sc3.wl=((*stu).sc1.wl)*0.30+((*stu).sc2.wl)*0.70;
  (*stu).sc3.hx=((*stu).sc1.hx)*0.30+((*stu).sc2.hx)*0.70;
  (*stu).sc3.sw=((*stu).sc1.sw)*0.30+((*stu).sc2.sw)*0.70;
  
  stu=stu->next;
  cout<<"| "<<setw(9)<<(*stu).mun;
        cout<<" |  "<<setw(6)<<(*stu).name;
  cout<<"  |  "<<setw(4)<<(*stu).sc3.yw;
  cout<<"  |  "<<setw(4)<<(*stu).sc3.sx;
  cout<<"  |  "<<setw(4)<<(*stu).sc3.yy;
  cout<<"  |  "<<setw(4)<<(*stu).sc3.wl;
  cout<<"  |  "<<setw(4)<<(*stu).sc3.hx;
  cout<<"  |  "<<setw(4)<<(*stu).sc3.sw;
  cout<<"  |  "<<endl;
 }
}
/////////////////////////////////*保存学生数据*////////////////////////////////////////
void readin(student *head)      
{   
 char a;
 student *stu=head->next;
 cout<<"现在保存输入学生数据,是否继续操作?(y/n)";
 cin>>a;
    ofstream  outfile("F:\\课设\\总评成绩.txt",ios::out);
 if(! outfile)
 {
  cout<<"打开文件错误!!!!!!!\n";
  exit(0);
 }  
 while(a!='n')
 {
  while(stu!=NULL)
  {    outfile<<"************************第"<<amount<<"个学生的数据:*************************\n";
        outfile<<"|    学号   |   姓名   |  语文  |  数学  |  英语  |  物理  |  化学  |  生物  |"<<endl;
  outfile<<"   平时成绩:   \n"
   <<"| "<<setw(9)<<(*stu).mun<<" |  "<<setw(6)<<(*stu).name<<"  |  "<<setw(4)<<(*stu).sc1.yw<<
   "  |  "<<setw(4)<<(*stu).sc1.sx<<"  |  "<<setw(4)<<(*stu).sc1.yy<<"  |  "<<setw(4)<<(*stu).sc1.wl
   <<"  |  "<<setw(4)<<(*stu).sc1.hx<<"  |  "<<setw(4)<<(*stu).sc1.sw<<endl;  
  outfile<<"   期末成绩:   \n"
   <<"| "<<setw(9)<<(*stu).mun<<" |  "<<setw(6)<<(*stu).name<<"  |  "<<setw(4)<<(*stu).sc2.yw<<
   "  |  "<<setw(4)<<(*stu).sc2.sx<<"  |  "<<setw(4)<<(*stu).sc2.yy<<"  |  "<<setw(4)<<(*stu).sc2.wl
   <<"  |  "<<setw(4)<<(*stu).sc2.hx<<"  |  "<<setw(4)<<(*stu).sc2.sw<<endl;  
  outfile<<"   总评成绩:  \n"
   <<"| "<<setw(9)<<(*stu).mun<<" |  "<<setw(6)<<(*stu).name<<"  |  "<<setw(4)<<(*stu).sc3.yw<<
   "  |  "<<setw(4)<<(*stu).sc3.sx<<"  |  "<<setw(4)<<(*stu).sc3.yy<<"  |  "<<setw(4)<<(*stu).sc3.wl
   <<"  |  "<<setw(4)<<(*stu).sc3.hx<<"  |  "<<setw(4)<<(*stu).sc3.sw<<endl;
  amount++;
  stu=stu->next;
  }
  break;
 }
    cout<<"......成功将学生数据保存到<总评成绩.txt>中! ";
 outfile.close();
}
/////////////////////////////////*录入学生数据*////////////////////////////////////////
void input(student *head)
{   
 char c;
 int j=0;
    student *p=head;
 file[j]=new ofstream("F:\\课设\\总评成绩.txt",ios::app);
 do
 {
  student *stu=new student;
  cout<<"请输入学号(9位数字):"<<setw(9); cin>>(*stu).mun;
  cout<<"请输入姓名:"<<setw(20);         cin>>(*stu).name;
  cout<<"请输入语文成绩(平时成绩和期末成绩):"<<setw(2);
  cin>>(*stu).sc1.yw>>(*stu).sc2.yw;
  cout<<"请输入数学成绩(平时成绩和期末成绩):"<<setw(2);
  cin>>(*stu).sc1.sx>>(*stu).sc2.sx;
  cout<<"请输入英语成绩(平时成绩和期末成绩):"<<setw(2);
  cin>>(*stu).sc1.yy>>(*stu).sc2.yy;
  cout<<"请输入物理成绩(平时成绩和期末成绩):"<<setw(2);
  cin>>(*stu).sc1.wl>>(*stu).sc2.wl;
  cout<<"请输入化学成绩(平时成绩和期末成绩):"<<setw(2);
  cin>>(*stu).sc1.hx>>(*stu).sc2.hx;
  cout<<"请输入生物成绩(平时成绩和期末成绩):"<<setw(2);
  cin>>(*stu).sc1.sw>>(*stu).sc2.sw;  
  (*stu).sc3.yw=((*stu).sc1.yw)*0.30+((*stu).sc2.yw)*0.70;//总成绩计算
  (*stu).sc3.sx=((*stu).sc1.sx)*0.30+((*stu).sc2.sx)*0.70;
  (*stu).sc3.yy=((*stu).sc1.yy)*0.30+((*stu).sc2.yy)*0.70;
  (*stu).sc3.wl=((*stu).sc1.wl)*0.30+((*stu).sc2.wl)*0.70;
  (*stu).sc3.hx=((*stu).sc1.hx)*0.30+((*stu).sc2.hx)*0.70;
  (*stu).sc3.sw=((*stu).sc1.sw)*0.30+((*stu).sc2.sw)*0.70;
  stu->next=p->next;
  p->next=stu;
  amount++;
  cout<<"数据录入成功,想继续录入吗(y/n)";  cin>>c;
  p=p->next;
  while(c!='y'&&c!='n')
  {
   cout<<"指令错误<请输入y/n!>!!!!!!"<<endl;
            cout<<"数据录入成功,想继续录入吗(y/n)";
   cin>>c;
  }
 }while(c=='y');
 j++;
 cout<<"输入了 "<<amount<<"个学生的信息."<<endl;
}
/////////////////////////////////*使用姓名查询学生数据*////////////////////////////////////////
void search1(student *head)//姓名查询
{
 char c;
 string name;
 do
 {
  student *stu=head->next;
  bool flag=0;
  cout<<"请输入你要查询的学生姓名:";
  cin>>name;
  do{  
   if(stu!=NULL&&name==(*stu).name)    //输出总成绩
   {
    flag=1;  
    cout<<"您要查询的学生是:"<<stu->name<<endl;
    cout<<"|    学号   |   姓名   |  语文  |  数学  |  英语  |  物理  |  化学  |  生物  |"<<endl;
    cout<<"| "<<setw(9)<<(*stu).mun;
    cout<<" |  "<<setw(6)<<(*stu).name;
    cout<<"  |  "<<setw(4)<<(*stu).sc3.yw;
    cout<<"  |  "<<setw(4)<<(*stu).sc3.sx;
    cout<<"  |  "<<setw(4)<<(*stu).sc3.yy;
    cout<<"  |  "<<setw(4)<<(*stu).sc3.wl;
    cout<<"  |  "<<setw(4)<<(*stu).sc3.hx;
    cout<<"  |  "<<setw(4)<<(*stu).sc3.sw;
    cout<<"  |  "<<endl;
   }   
   stu=stu->next;  
  }while(stu!=NULL);
  if(flag==0)
   cout<<"对不起!您要查询的学生不存在!!!!!!!"<<endl;
  cout<<"您想继续查询吗?(y/n)";    cin>>c;
  while(c!='y'&&c!='n')
  {
   cout<<"指令错误<请输入y/n!>!!!!!!!"<<endl;
        cout<<"您想继续查询吗?(y/n)";    cin>>c;
  }
 } while(c=='y');  
}
/////////////////////////////////*用学号查询学生数据*////////////////////////////////////////
void search2(student *head)//学号查询
{
 char c;string no;
 do
 {
  student *stu=head->next;
  int flag=0;
  cout<<"请输入你要查询的学生学号:";
  cin>>no;  
  do
  {
   if(stu!=NULL&&no==(*stu).mun)
   {
    flag=1;
    cout<<"您要查询的学生是:"<<stu->name<<endl;
    cout<<"|    学号   |   姓名   |  语文  |  数学  |  英语  |  物理  |  化学  |  生物  |"<<endl;
       cout<<"| "<<setw(9)<<(*stu).mun;
    cout<<" |  "<<setw(6)<<(*stu).name;
    cout<<"  |  "<<setw(4)<<(*stu).sc3.yw;
    cout<<"  |  "<<setw(4)<<(*stu).sc3.sx;
    cout<<"  |  "<<setw(4)<<(*stu).sc3.yy;
    cout<<"  |  "<<setw(4)<<(*stu).sc3.wl;
    cout<<"  |  "<<setw(4)<<(*stu).sc3.hx;
    cout<<"  |  "<<setw(4)<<(*stu).sc3.sw;
    cout<<"  |  "<<endl;   
   }
   stu=stu->next;
  }while(stu!=NULL);
  if(flag==0)
   cout<<"对不起!您要查询的学生不存在!!!!!!!"<<endl;
  cout<<"您想继续查询吗?(y/n)";
  cin>>c;
  while(c!='y'&&c!='n')
  {
   cout<<"指令错误<请输入y/n!>!!!!!!!"<<endl;
            cout<<"您想继续查询吗?(y/n)"<<endl;
   cin>>c;
  }   
 }while(c=='y');
}
/////////////////////////////////*修改学生数据*////////////////////////////////////////
void change(student *head)
{  
 string name; char c;
 do
 {
  bool flag2=0;
  student *stu=head ;
  score sc1;
  score sc2;
  score sc3;
  cout<<"请输入您要修改的学生的姓名:";
  cin>>name;
  do
  {
   if(name==(*stu).name)
   {  
    flag2=1;
    cout<<"请输入新的.语文.成绩(平时成绩和期末成绩):";
    cin>>sc1.yw>>sc2.yw;
    cout<<"请输入新的.数学.成绩(平时成绩和期末成绩):";
    cin>>sc1.sx>>sc2.sx;
    cout<<"请输入新的.英语.成绩(平时成绩和期末成绩):";
    cin>>sc1.yy>>sc2.yy;
    cout<<"请输入新的.物理.成绩(平时成绩和期末成绩):";
    cin>>sc1.wl>>sc2.wl;
    cout<<"请输入新的.化学.成绩(平时成绩和期末成绩):";
    cin>>sc1.hx>>sc2.hx;
    cout<<"请输入新的.生物.成绩(平时成绩和期末成绩):";
    cin>>sc1.sw>>sc2.sw;
    sc3.yw=sc1.yw*0.30+sc2.yw*0.70;//总成绩计算
    sc3.sx=sc1.sx*0.30+sc2.sx*0.70;
    sc3.yy=sc1.yy*0.30+sc2.yy*0.70;
    sc3.wl=sc1.wl*0.30+sc2.wl*0.70;
    sc3.hx=sc1.hx*0.30+sc2.hx*0.70;
    sc3.sw=sc1.sw*0.30+sc2.sw*0.70;  
    (*stu).sc3.yw=sc3.yw;
    (*stu).sc3.sx=sc3.sx;
    (*stu).sc3.yy=sc3.yy;
    (*stu).sc3.wl=sc3.wl;
    (*stu).sc3.hx=sc3.hx;
    (*stu).sc3.sw=sc3.sw;
    cout<<"|    学号   |   姓名   |  语文  |  数学  |  英语  |  物理  |  化学  |  生物  |"<<endl;
    cout<<"| "<<setw(9)<<(*stu).mun;
    cout<<" |  "<<setw(6)<<(*stu).name;
    cout<<"  |  "<<setw(4)<<(*stu).sc3.yw;
    cout<<"  |  "<<setw(4)<<(*stu).sc3.sx;
    cout<<"  |  "<<setw(4)<<(*stu).sc3.yy;
    cout<<"  |  "<<setw(4)<<(*stu).sc3.wl;
    cout<<"  |  "<<setw(4)<<(*stu).sc3.hx;
    cout<<"  |  "<<setw(4)<<(*stu).sc3.sw;
    cout<<"  |  "<<endl;
    cout<<".......数据修改成功!\n";
    break;
   }
   stu=stu->next;
  }while(stu!=NULL);
  if(flag2==0)
  {
   cout<<"对不起!您要修改的学生不存在!请检查重新输入!!!!!!!"<<endl;
  }
  cout<<"想继续修改吗?(y/n)";
  cin>>c;
  if(c!='y'&&c!='n')
  {
   cout<<"指令错误!请重新输入<y/n>!!!!!!!";
   cin>>c;
  }
 }while(c=='y');
 
}
/////////////////////////////////*删除学生数据*////////////////////////////////////////
void shanchu(student *head)//学号
{
 char c;string no;
 do
 {
  int flag=0;
  cout<<"请输入你要删除的学生学号:";
  cin>>no;
  
  student *q,*p;
  q=head;
  while(q->next!=NULL&&q->next->mun!=no)
   q=q->next;
  if(q->next!=NULL)
  {  
   flag=1;
   p=q->next;
   q->next=q->next->next;
   amount--;
   free(p);
            cout<<"......成功删除! ";
  }
  if(flag==0)
   cout<<"对不起!您要删除的学生不存在!!!!!!!"<<endl;  
  cout<<"您想继续删除吗?(y/n)";
  cin>>c;
  while(c!='y'&&c!='n')
  {
   cout<<"指令错误<请输入y/n!>!!!!!!!"<<endl;
            cout<<"您想继续删除吗?(y/n)";
   cin>>c;
  }  
 }while(c=='y');
}
/////////////////////////////////*提取学生数据*////////////////////////////////////////
void get(student *head)
{
 student *p;
 p=head;
 int j=0;
 string no;
    cout<<"请输入您想提取的入学年份+在读年级+在读班级的编号(7位数字):";
 cin>>no;
 while(p->next!=NULL)
 {
        if(no==(p->next->mun).substr(0,7))
  {
   cout<<"管理系统有您要提取的信息!"<<endl;
   j=1;
  }
  else p=p->next;
  if(j==1)
   break;
 }
 if(j==1)
 {   
  int c,m=0;
  string b,b1,e,subject[6]={"yuwen","shuxue","yinyu","wuli","huaxue","shengwu"};
  string kemu[6]={"语文","数学","英语","物理","化学","生物"};
  cout<<"输入您想提取的科目代码:"<<endl;
  cout<<"1-->语文       2-->数学      3-->英语"<<endl;
  cout<<"4-->物理       5-->化学      6-->生物"<<endl;
  cout<<"选择:"; cin>>c;
        string cla="class";
  e=no.substr(6,1);
        b1=cla+e;
        b=b1+subject[c-1];
  char *f=new char[20];
  for(int i=0;i<20;i++)
   f[i]=b[i];
  f=strcat(f,".txt");
        ofstream outfile(f,ios::out);
        if(! outfile)
  {
   cout<<"打开错误!!!!!!!"<<endl;
   exit(1);
  }
        outfile<<"\t您要提取的信息\t\t\t"<<endl;
        outfile<<" -----------------------------"<<endl;
        outfile<<"|    学号    |   姓名  | ";
        outfile<<kemu[c-1]<<" |"<<endl;
        while(p->next!=NULL)
  {
   outfile<<" -----------------------------"<<endl;
   outfile<<"|"<<setw(11)<<p->next->mun<<" | "<<setw(6)<<p->next->name<<"  |";
            switch(c)
   {
   case 1:outfile<<setw(5)<<p->next->sc3.yw<<" |";
    outfile<<endl;
    break;
   case 2:outfile<<setw(5)<<p->next->sc3.sx<<" |";
    outfile<<endl;
    break;
   case 3:outfile<<setw(5)<<p->next->sc3.yy<<" |";
    outfile<<endl;
    break;
   case 4:outfile<<setw(5)<<p->next->sc3.wl<<" |";
    outfile<<endl;
    break;
   case 5:outfile<<setw(5)<<p->next->sc3.hx<<" |";
    outfile<<endl;
    break;
   case 6:outfile<<setw(5)<<p->next->sc3.sw<<" |";
    outfile<<endl;
    break;
   }
   p=p->next;
  }
        outfile<<" -----------------------------"<<endl;
        outfile.close();
  cout<<"......已经保存在"<<f<<"文本文档中!"<<endl;
 }
 if(j==0)
  cout<<"管理系统中没有您要提取的班级数据!!!!!!!!"<<endl;
}

}

搜索更多相关主题的帖子: 改错 
2010-06-29 23:34
你们都要疼我哦
Rank: 11Rank: 11Rank: 11Rank: 11
来 自:火星
等 级:贵宾
威 望:49
帖 子:1296
专家分:2746
注 册:2008-7-13
收藏
得分:0 
哎 c++呀

小妹,哥哥看你骨骼清奇,绝非凡人,将来必成大业,不如这样,你先把裤裤脱了,待哥哥为你开启灵窍,然后我们一起努力钻研如何
2010-06-30 04:21
pbreak
Rank: 7Rank: 7Rank: 7
等 级:黑侠
威 望:1
帖 子:83
专家分:558
注 册:2007-5-10
收藏
得分:3 
结构体 和类后面加;
struct score
{
float yw;
float sx;
float yy;
float wl;
float hx;
float sw;
struct score *next;
};
/////////////////////////////////*学生数据类*////////////////////////////////////////
class student   
{
public:
string mun;
string name;
    score sc1;
score sc2;
score sc3;//平时成绩,期末成绩,总成绩;
class student *next;
};
2010-06-30 09:03
fanxuechao
Rank: 2
来 自:新疆
等 级:论坛游民
帖 子:19
专家分:27
注 册:2010-6-9
收藏
得分:0 
回复 3楼 pbreak
谢谢了!!!!!!!!!!!我去试一下!!!!
2010-06-30 09:49
fanxuechao
Rank: 2
来 自:新疆
等 级:论坛游民
帖 子:19
专家分:27
注 册:2010-6-9
收藏
得分:0 
回复 3楼 pbreak
不行啊!!!!你给的这个代码源程序里有啊!!!!还是有一个错误!!!
error C2236: unexpected 'class' 'student'
error C2143: syntax error : missing ';' before '{'
error C2447: missing function header (old-style formal list?)
error C2011: 'score' : 'struct' type redefinition
............
2010-06-30 10:09
pbreak
Rank: 7Rank: 7Rank: 7
等 级:黑侠
威 望:1
帖 子:83
专家分:558
注 册:2007-5-10
收藏
得分:7 
注意红色的部分,后面加一个;号
struct score
{
float yw;
float sx;
float yy;
float wl;
float hx;
float sw;
struct score *next;
};
/////////////////////////////////*学生数据类*////////////////////////////////////////
class student   
{
public:
string mun;
string name;
    score sc1;
score sc2;
score sc3;//平时成绩,期末成绩,总成绩;
class student *next;
};


[ 本帖最后由 pbreak 于 2010-6-30 10:53 编辑 ]
2010-06-30 10:51
fanxuechao
Rank: 2
来 自:新疆
等 级:论坛游民
帖 子:19
专家分:27
注 册:2010-6-9
收藏
得分:0 
回复 6楼 pbreak
谢谢!!!!!!
2010-06-30 11:08
fanxuechao
Rank: 2
来 自:新疆
等 级:论坛游民
帖 子:19
专家分:27
注 册:2010-6-9
收藏
得分:0 
回复 6楼 pbreak
运行成功!!!!!
2010-06-30 11:13
kekin
Rank: 2
等 级:论坛游民
帖 子:59
专家分:85
注 册:2010-3-26
收藏
得分:0 
这个程序还是不规范的,还多了最后个大括号
这是没有退格造成的低级错误
写程序最好退格
2010-06-30 17:38
fanxuechao
Rank: 2
来 自:新疆
等 级:论坛游民
帖 子:19
专家分:27
注 册:2010-6-9
收藏
得分:0 
回复 9楼 kekin
恩!!!!有道理!!!!!领教!!!
2010-06-30 17:49
快速回复:那位大哥帮我改错!!!!
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.016074 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved