Two polytes are added!

xiaoxiao2021-03-06  16

Hello everyone! I am a primary school C language and data structure!

The following is a program that I have added by my single-link table, I don't know why there are two ErrorS in TurboC2.0, and it is "Declaration Syntax Error" also invited the industry expert guidance! Thank you! !

#include "math.h" #include "stdio.h" Typedef struct Node {float coef; int exp; int flag; struct Node * next;} PolyNode, * LinkList; LinkList creat_LinkList () {LinkList l; PolyNode * s, * r; float x; int y; int flag; l = r = null; scanf ("% e,% d", & x, & y); while (x && y) {s = (polyNode *) malloc (Sizeof (PolyNode) ); S-> COEF = x; S-> EXP = Y; if (l == null) L = S; ELSE {r-> Next = S; r = s; Scanf ("% E,% D", & x, & y); = NEXT = NULL; RETURN L;} LinkList Add (Linklist A, Linklist B, Linklist C) {PolyNode * Head_a, * head_b, * head_c, * p, * q, * r, * s; head_a = a; head_b = b; head_c = C; p = head_a; q = head_b; r = head_c; free (b); while (q-> next! = null) {q = Q-> Next; if (q-> exp == p-> next) {r-> Coef = P-> Coef Q-> Coef; if (r-> Coef) {r-> exp = P- > exp;} else free (r); p-> flag = 1; Q-> flag = 1; p = p-> next; q = head_b;} else {r-> Coef = P-> Coef; r- > exp = p-> exp; p-> flag = 1; p = p-> next; q = head_b;} if (q-> flag == 0) {while (r-> next! = null) {r = r-> Next; if (r-> exp> q-> exp) {s = head_c; while (s-> next! = r) {q-> next = S- > next; s-> next = q;}} else {r-> next = q; q-> flag = 1;}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}} Return C;} main () {linklist creat_linklist (); linkList A, B, c; PolyNode * r; printf ( "please enter the first ploynomail following the form of" coef, exp ""); a = creat_LinkList (); printf ( "please enter the second ploynomail following the form of" coef, exp "" ); B = creat_linklist ();

转载请注明原文地址:https://www.9cbs.com/read-41335.html

New Post(0)