测试点2应该是只输入1对并且是一个常数,如3 0这种。应该输出0 0。
#include <bits/stdc++.h>
using namespace std;
vector<int> a,b;//系数 指数
int main(){
int xs,zs;
while(cin>>xs>>zs){
a.push_back(xs);
b.push_back(zs);
}
if(a.size()==1 && b[0]==0){
cout << "0 0";
return 0;
}
int flag = 0;
for(int i=0;i<(int)a.size();i++){
int xishu = a[i];
int zhishu = b[i];
if(zhishu==0) continue;
if(flag) cout << " ";
cout<< xishu*zhishu<< " " << zhishu-1;
flag++;
}
return 0;
}
标签:int,多项式,back,push,求导,xs,1010,zs
From: https://www.cnblogs.com/chengyiyuki/p/18132964