PAT上分记(c++ + 完美过关)---1010 一元多项式求导 (25分)

一元多项式求导(c++)

在这里插入图片描述

#include <stdio.h>
#include <iostream>

int main() {

	int a, b;

	bool first = true;

	while (std::cin >> a >> b) {
		if (b != 0 && a != 0) {
			if (!first) {
				std::cout << " ";
			}
			std::cout << a * b << " " << b - 1;
			first = false;
		}
	}

	if (first) {
		std::cout << "0 0";
	}

	return 0;
}

发布了16 篇原创文章 · 获赞 3 · 访问量 515

猜你喜欢

转载自blog.csdn.net/godleisen/article/details/103890593