PAT1010. 一元多项式求导 (25)(未通过)

来源:互联网 发布:淘宝的车秒贷怎么样 编辑:程序博客网 时间:2024/06/05 16:09

这个题我是过不去了。。

//============================================================================// Name        : pat.cpp// Author      : // Version     :// Copyright   : Your copyright notice// Description : Hello World in C++, Ansi-style//============================================================================#include <iostream>using std::cin;using std::cout;using std::endl;int number;int power;int main() {bool first=true;while(cin>>number&&cin>>power){if(number!=0&&power!=0){if(first){first=false;}else{cout<<" ";}cout<<number*power<<" "<<power-1;}else if(power==0){continue;} else{if(first){first=false;}else{cout<<" ";}cout<<"0 0";}}}


0 0
原创粉丝点击