int initial(linkpoint head,char* filename)
{
ifstream f(filename);
if (!f)
{
cout<<"文件打开错误"<<endl;
return 1;
}
int num;
data d;
f>>num;
if (num==0)
{
cout<<"多项式不存在"<<endl;
return 1;
}
while (num>0)
{
num--;
f>>d.factor;
f>>d.index;
linklist_insert(head, d);
}
return 1;
}
{
ifstream f(filename);
if (!f)
{
cout<<"文件打开错误"<<endl;
return 1;
}
int num;
data d;
f>>num;
if (num==0)
{
cout<<"多项式不存在"<<endl;
return 1;
}
while (num>0)
{
num--;
f>>d.factor;
f>>d.index;
linklist_insert(head, d);
}
return 1;
}