题目截图:

思路:
简单模拟。
代码:
1 /*
2 1010. 一元多项式求导
3 */
4
5 #include <stdio.h>
6 #include <string.h>
7 #include <math.h>
8 #include <stdlib.h>
9 #include <time.h>
10
11 int main() {
12 int a, b, flag=0;
13 while(scanf("%d %d", &a, &b) != EOF) {
14 if(flag==0 && b==0) { // 零多项式
15 printf("0 0");
16 }
17 if(b != 0) {
18 if(flag) {
19 printf(" ");
20 }
21 // 模拟多项式求导
22 printf("%d %d", a*b, b-1);
23 flag = 1;
24 }
25 }
26
27 return 0;
28 }
来源:http://www.cnblogs.com/coderJiebao/p/PAT1010.html