#include
using namespace std;
int main() {
bool factor(int n,int &a, int &b);
int number, a, b;
cout << "please input a number:";
cin >> number;
bool error = factor(number, a, b);
if (error)
cout << "error!" << endl;
else
{
cout << "the number is:"<<number << endl;
cout << "a=" << a << endl;
cout << "b=" << b << endl;
}
}
bool factor(int n, int &a, int &b) {
if (a > 20 || a < 0)
return true;
a = n * n;
b = n * n * n;
return false;
}