大家帮我解决一下
#include<iostream>#include<iomanip>
using namespace std;
class score{
public:
score();
~score();
void inscore();
void showscore();
private:
double math, english, programming, ave;
char num[10];
};
void score::inscore(){
cout << "num:";
cin >> num;
cout << "Input math,english,programming score:";
cin >> math >> english >> programming;
ave = (math + english + programming) / 3;
}
void score::showscore(){
cout << num << setw(6) << math << setw(5)
<< english << setw(5) << programming << setw(5) << ave << "\n";
}
int main(){
score a[10];
int n;
cin >> n;
for (int i = 0; i < n; i++)
a[i].inscore();
cout << "num" << setw(6) << "math" << setw(5) << "english"
<< "programming" << setw(5) << "ave";
for (int i = 0; i < n; i++)
a[i].showscore();
}
错误 1 error LNK2019: 无法解析的外部符号 "public: __thiscall score::score(void)" (??0score@@QAE@XZ),该符号在函数 _main 中被引用 C:\Users\pengcheng\Documents\Visual Studio 2013\Projects\practice\practice\源.obj practice
错误 2 error LNK2019: 无法解析的外部符号 "public: __thiscall score::~score(void)" (??1score@@QAE@XZ),该符号在函数 _main 中被引用 C:\Users\pengcheng\Documents\Visual Studio 2013\Projects\practice\practice\源.obj practice
错误 3 error LNK1120: 2 个无法解析的外部命令 C:\Users\pengcheng\Documents\Visual Studio 2013\Projects\practice\Debug\practice.exe 1 1 practice