qq_32950413 于 2016.03.25 21:24 提问

[Error] a function-definition is not allowed here before '{' token
[Error] expected '}' at end of input

7个回答

qq_32950413   2016.03.25 21:25

qq_32950413   2016.03.25 21:28

qq_32950413   2016.03.25 21:29

qq_32950413   2016.03.25 21:30

qq_32950413   2016.03.25 21:33

#include using namespace std;
struct Node{float coef; //系数
int exp; //指数Node next;};
void PrintList( );
void PloyMul();void ExitSystem();
(q->coef); s-exp=p->exp+q-exp; r=s; r->next=Null; pr=p; p=p->next; } Add(D,C); qr=q; q=q->next; p=pr->next;}if(q==NULL){Sort(D);D.PrintList();} else{ cout<<"error!"<>n1; LinkList A(n1); Sort(A); cout<<"输入第二个多项式的项数："<>n2; LinkList B(n2); Sort(B); cout<<"相乘后结果："; Mul(A,B); cout<<"\n是否继续" }}void LinkList::ExitSystem(){ exixt(1);}void LinkList::Menu(){ while(true){ char sign; cout<<"\n\n"; cout<<"1.chengfa"; cout<<"2.tuichu"; cout<<""; cin>>sign; switch(sign) {case'1':PloyMul(); break; case'2':ExitSystem(); break; default:break; } cin.sync(); system("cls"); }}int main(){ Menu(); return 0;}

qq423399099      2016.03.25 22:07

`````` struct Node{
float coef; //系数
int exp; //指数
Node next;//应该改为Node *next;
};
{
Node*p,*r;
for(int i=0;i>p->coef>>p->exp; p->next=r->next; r->next=p;}//for循环中居然出现了4个分号。。。
}
``````
CSDNXIAOD   2016.03.30 11:25

----------------------biu~biu~biu~~~在下问答机器人小D，这是我依靠自己的聪明才智给出的答案，如果不正确，你来咬我啊！