编译无错,链接出错,求指教
/*学生管理系统*/#include <iostream>
#include <string>
using namespace std;
void Input_i();
void Scan_i();
struct Input_system
{
long num;
string name;
int highmath;
int english;
int cpp;
int computer;
};
int main()
{
cout<<" ***********欢迎使用学生管理系统*********** \n"
<<" *** *** \n"
<<" *** 1.录入信息. 2.查询信息. *** \n"
<<" *** 3.关于程序. 4.退出. *** \n"
<<" *** *** \n"
<<" *** *** \n"
<<" *** maked by Zhanjixun *** \n";
int chose;
cout<<"请选择你要执行的操作:";
cin>>chose;
while(1)
{
if(chose!=1&&chose!=2&&chose!=3&&chose!=4)
{
cout<<"错误!请重新输入:";
cin>>chose;
}
if(chose==1)
{
Input_i();
cout<<"完成录入!\n"
<<"请选择你要执行的操作:";
cin>>chose;
}
if(chose==2)
Scan_i();
if(chose==3)
{
cout<<" 本程序用于管理学生成绩信息。可录入\n"
<<"学生学号、姓名、高数成绩、英语成绩、C++程序设计成绩、计算机导\n"
<<"论成绩。"<<endl;
cout<<"请选择你要执行的操作:";
cin>>chose;
}
if(chose==4)
break;
}
if(chose==4)
{
cout<<"感谢你的使用,欢迎再次使用。再见!";
system("pause");
exit(0);
}
return 0;
}
static int i=1;
void Input_i()
{
Input_system students[80];
cout<<"请输入学生学号:";
cin>>students[i].num;
cout<<"请输入学生姓名:";
cin>>students[i].name;
cout<<"请输入该生高数成绩:";
cin>>students[i].highmath;
cout<<"请输入该生英语成绩:";
cin>>students[i].english;
cout<<"请输入该生C++成绩:";
cin>>students[i].cpp;
cout<<"请输入该生导论成绩:";
cin>>students[i].computer;
i++;
}
void Scan_i()
{
extern int i;
if(i==1)
{
//extern chose;
cout<<"未录入学生信息,无法查询!\n"
<<"请先录入学生信息!\n";
//cin>>chose;
}
cout<<"请选择查询方式:\n"
<<"1.按学号.\n"
<<"2.按姓名.\n";
int look;
cin>>look;
while(1)
{
if(look!=1&&look!=2)
{
cout<<"错误!请重新选择。";
cin>>look;
}
else break;
}
if(look==1)
{
extern Input_system student[80];
cout<<"请输入学号:";
Input_system scan;
cin>>scan.num;
for(i=1;i<80;i++)
if(student[i].num==scan.num)
{
cout<<"学号 姓名 高数成绩 英语成绩 C++成绩 导论成绩";
cout<<student[i].num<<" "<<student[i].name<<" "<<student[i].highmath<<" "<<student[i].english<<" "<<student[i].cpp<<" "<<student[i].computer<<" ";
break;
}
}
if(look==2)
{
extern Input_system student[80];
cout<<"请输入姓名:";
Input_system scan;
cin>>scan.name;
for(i=1;i<80;i++)
if(student[i].name==scan.name)
{
cout<<"学号 姓名 高数成绩 英语成绩 C++成绩 导论成绩";
cout<<student[i].num<<" "<<student[i].name<<" "<<student[i].highmath<<" "<<student[i].english<<" "<<student[i].cpp<<" "<<student[i].computer<<" ";
break;
}
}
}