some fixes
parent
6da915f09a
commit
49aed84225
|
@ -151,6 +151,10 @@ void print_polynomial(Polynomial *p, char letter) {
|
|||
for (int i = 0; i < p->size; i++) {
|
||||
Term term = p->terms[i];
|
||||
|
||||
if (term.coefficient == 0) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// Печать знака (не печатаем '+' перед первым слагаемым)
|
||||
if (i != 0 || term.coefficient < 0) {
|
||||
printf("%c", term.coefficient > 0 ? '+' : '-');
|
||||
|
|
Loading…
Reference in New Issue