mirror of
https://github.com/xlucn/PAT.git
synced 2026-02-07 19:43:43 +08:00
20 lines
326 B
C
20 lines
326 B
C
#include <stdio.h>
|
|
|
|
int main()
|
|
{
|
|
int coef, index, count = 0;
|
|
|
|
while (scanf("%d %d", &coef, &index) != EOF) {
|
|
if (index) { /* Constant terms result in zero */
|
|
if (count++) putchar(' ');
|
|
printf("%d %d", coef * index, index - 1);
|
|
}
|
|
}
|
|
|
|
/* Zero polynomial or constant */
|
|
if (count == 0)
|
|
puts("0 0");
|
|
|
|
return 0;
|
|
}
|