1010 一元多项式求导 (25 分)
输入样例:
3 4 -5 2 6 1 -2 0
输出样例:
12 3 -10 1 6 0
代码
#include <stdio.h>
#include <stdbool.h>
#include <string.h>
#include <stdlib.h>
#define BUFSZ 1024*10
char buf[BUFSZ];
typedef struct{
int coef;
int expo;
} T;
T item[1024];
int total=0;
void append(T nt){
item[total]=nt;
total++;
// printf("append:%d,%d\n", nt.coef,nt.expo);
}
void read_data(){
fgets(buf, BUFSZ, stdin);
char *p;
char *delim = " \n";
p = strtok(buf, delim);
T it;
while (p)