如果没有非零项,那么需要输出 “0 0”
#include <bits/stdc++.h>
using namespace std;
#define ll long long
map<string,string> m;
typedef struct{
int b,e;
}node;
node x;
vector<node> v;
int main()
{
ll i,j,k;
while(cin>>x.b>>x.e)
{
if(x.e==0||x.b==0) continue;
else
{
x.b*=x.e; --x.e;
v.push_back(x);
}
}
for(i=0;i<v.size();++i)
{
if(i>0) cout<<" ";
printf("%d %d",v[i].b,v[i].e);
}
if(v.size()==0) printf("0 0");
return 0;
}