那位大神帮我看看这个程序那错了,,怎么运行不了
c++吧
全部回复
仅看楼主
level 4
#include <iostream>
#include <string>
#include<fstream>
#include<iomanip>
using namespace std;
int amount=0; /* 记录学生个数 */
ofstream *file[50];
struct score /* 学生成绩结构体*/
{
float jg; float yl;
float yy;
float wy;
struct score * next;
};
class student /* 学生数据类*/
{ public: string mun;
string name;
score sc1;
class student * next;
};
void display() /* 显示菜单*/
{
cout<<"***制作人:赵恒; 班级:计科; 学号:***\n";
cout<<" $ [0]-录入; [1]-查询; [2]-修改; $\n";
cout<<" $ [3]-删除; [4]-显示; [5]-初始化; $\n";
cout<<" $ [6]-保存; [9]-退出; $\n";
cout<<" 请选择相应的数字进行操作: ";
};
void input(student * head); /* 录入 */
void search1(student * head); /* 姓名查询 */
void search2(student * head); /* 学号查询 */
void change(student * head); /* 修改 */
void shanchu(student * head); /* 删除 */
void display(); /* 显示菜单 */
void show(student * head); /* 显示数据 */
void readin(student * head); /* 保存数据 */
void chushihua(student * head); /* 初始化 */
void main() /* 主函数 */
{
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;/* 按学号查询 */
}
break;
}
cout<<endl;
exit(0);
break;
}
}
while(flag2==1);
}
2012年12月23日 05点12分 1
level 4
没人么
2012年12月23日 05点12分 2
level 8
void search1(student * head){
}
void search2(student * head){
}
void show(student * head){
}
void input(student * head){
}
最后面把这几个加上就OK了
2012年12月23日 05点12分 3
谢谢你,。,,,爱死你了,哈哈
2012年12月23日 05点12分
回复 赵恒vs尾巴 :我不是基佬。。。。。。。
2012年12月23日 05点12分
1