written by: 东篱下の悠然
思路:模拟题目,将x, y成对输入,输出x * y 和 y - 1,如果是零多项式,就输出“0 0”
代码:
#include<bits/stdc++.h>
using namespace std;
int main() {
int x, y;
bool f = 0;
while(cin >> x >> y) {
if(y == 0) continue;
if(f) cout << " ";
cout << x * y << " " << y - 1;
f = 1;
}
if(f == 0) cout << "0 0";
return 0;
}