/* Sample solution for St. Ives Steven J Zeil */ #include #include #include using namespace std; void stIves (istream& in) { int multiplier; in >> multiplier; int total = 1; // man total += multiplier; // wives total += multiplier*multiplier; // sacks total += multiplier*multiplier*multiplier; // cats total += multiplier*multiplier*multiplier*multiplier; // kittens cout << total << endl; } int main (int argc, char** argv) { if (argc == 1) stIves(cin); else { ifstream in (argv[1]); stIves (in); } return 0; }