查重代码运行总是出现这个弹窗,该怎么解决?
用容器输入数据之后,输出不显示是为什么?
class Admin:public User
{
public:
std::vector<Reference>str;
Reference tmp;
void input()//录入数据
{
cout << "请输入要录入的文献数\n";
int n;
cin >> n;
for (int i = 0; i < n; i++)
{
cout << "请输入第" << i+1 << "篇文献的数据"<<endl;
cin >> tmp.DOI >> tmp.author >> tmp.topic >> tmp.pub >> tmp.year >> tmp.type;
str.push_back(tmp);
}
/*for (vector<Reference>::iterator it = str.begin(); it != str.end(); it++)
{
if ((*it).DOI == (*(it-1)).DOI)
{
cout << "录入数据有误,请重新录入"<<endl;
}
}//查重*/
}
void save()//保存数据
{
ofstream outFile;
outFile.open("article.txt");
for (vector<Reference>::iterator it = str.begin(); it != str.end(); it++)
{
outFile << (* it).DOI << (*it).author << (*it).pub << (*it).topic << (*it).year << (*it).type;
}
outFile.close();
cout << "保存成功"<<endl;
}
void open()
{
char a[1000];
ifstream fin;
fin.open("article.txt");
system("chcp 65001");
fin >> a;
cout << a;
}
void display()
{
for (vector<Reference>::iterator it = str.begin(); it != str.end(); it++)
{
cout << (*it).DOI << (*it).author << (*it).pub << (*it).topic << (*it).year << (*it).type << endl;
}
}
};