大水题一道,不多说了。
源代码:
#include <iostream>
using namespace std;
int main()
{
int a, b, s= 0;
while (cin >> a >> b) {
if (b) {
if (s == 1) cout << " ";
cout << a * b << " " << b - 1;
s = 1;
}
}
if (!s) cout << "0 0";
return 0;
}
#include <iostream>
using namespace std;
int main()
{
int a, b, s= 0;
while (cin >> a >> b) {
if (b) {
if (s == 1) cout << " ";
cout << a * b << " " << b - 1;
s = 1;
}
}
if (!s) cout << "0 0";
return 0;
}