4 p1->next=head1->next;
125 head1->next=p1;
126 }
127 else
128 {
129 if (mark==0)
130 {
131 p1=(output1 *)malloc (sizeof(output1));
132 Num(p1, &N[0][0], 0);
133 p1->next=head1->next;
134 head1->next=p1;
135
136 p1=(output1 *)malloc (sizeof(output1));
137 Di(p1, &D[0][0], di);
138 p1->next=head1->next;
139 head1->next=p1;
140
141 p1=(output1 *)malloc (sizeof(output1));
142 Num(p1, &N[0][0], psnew->wei);
143 p1->next=head1->next;
144 head1->next=p1;
145 }
146 else
147 {
148 p1=(output1 *)malloc (sizeof(output1));
149 Di(p1, &D[0][0], di);
150 p1->next=head1->next;
151 head1->next=p1;
152
153 p1=(output1 *)malloc (sizeof(output1));
154 Num(p1, &N[0][0], psnew->wei);
155 p1->next=head1->next;
156 head1->next=p1;
157 }
158 }
159 }
160 sign=1;
161 flag=1;
162
163 if (mark==0)
164 mark=1;
165
166 re=re+1;
167 }
168 }
169 else
170 {
171 if (psnew->wei==0)
172 {
173 if (mark==1)
174 mark=0;
175
176 re=(re+1)%4;
177 if (re==0)
178 di=di+4;
179 }
180 else
181 {
182 if (sign==0)
183 {
184 if (di==1)
185 {
186 p1=(output1 *)malloc (sizeof(output1));
187 Re(p1, &R[0][0], re);
188 p1->next=NULL;
189 head1->next=p1;
190
191 p1=(output1 *)malloc (sizeof(output1));
192 Num(p1, &N[0][0], psnew->wei);
193 p1->next=head1->next;
194 head1->next=p1;
195 }
196 else
197 {
198 p1=(output1 *)malloc (sizeof(output1));
199 Di(p1, &D[0][0], di);
200 p1->next=NULL;
201 head1->next=p1;
202
203 p1=(output1 *)malloc (sizeof(output1));
204 Re(p1, &R[0][0], re);
205 p1->next=head1->next;
206 head1->next=p1;
207
208 p1=(output1 *)malloc (sizeof(output1));
209 Num(p1, &N[0][0], psnew->wei);
210 p1->next=head1->next;
211 head1->next=p1;
212 }
213 }
214 else
215 {
216 if (flag==0)
217 {
218 p1=(output1 *)malloc (sizeof(output1));
219 Di(p1, &D[0][0], di);
220 p1->next=head1->next;
221 head1->next=p1;
222
223 p1=(output1 *)malloc (sizeof(output1));
224 Re(p1, &R[0][0], re);
225 p1->next=head1->next;
226 head1->next=p1;
227
228 p1=(output1 *)malloc (sizeof(output1));
229 Num(p1, &N[0][0], psnew->wei);
230 p1->next=head1->next;
231 head1->next=p1;
232 }
233 else
234 {
235 if (mark==0)
236 {
237 p1=(output1 *)malloc (sizeof(output1));
238 Num(p1, &N[0][0], 0);
239 p1->next=head1->next;
240 head1->next=p1;
241
242 p1=(output1 *)malloc (sizeof(output1));
243 Re(p1, &R[0][0], re);
244 p1->next=head1->next;
245 head1->next=p1;
246
247 p1=(output1 *)malloc (sizeof(output1));
248 Num(p1, &N[0][0], psnew->wei);
249 p1->next=head1->next;
250 head1->next=p1;
251 }
252 else
253 {
254 p1=(output1 *)malloc (sizeof(output1));
255 Re(p1, &R[0][0], re);
256 p1->next=head1->next;
257 head1->next=p1;
258
259 p1=(output1 *)malloc (sizeof(output1));
260 Num(p1, &N[0][0], psnew->wei);
261 p1->next=head1->next;
262 head1->next=p1;
263 }
264 }
265 }
266 sign=1;
267 flag=1;
268
269 if (mark==0)
270 mark=1;
271
272 re=(re+1)%4;
273 if (re==0)
274 di=di+4;
275 }
276 }
277
278 psnew=psnew->next;
279 }
280
281 psnew1=head1->next;
282 while (psnew1!=NULL) //输出转换结果
283 {
284 pri |