#include #include using namespace std; //////// Function Prototypes //////// void PrintLine(char, int); int main() { ifstream inFile; int rainfall = 0; char myChar; string fName = "rainfall.in"; inFile.open(fName.c_str()); // NOTE: this is not a robust program because it doesn't // test for success inFile >> myChar; inFile >> rainfall; while (inFile) { // Print a line PrintLine(myChar, rainfall); inFile >> rainfall; } return 0; } void PrintLine(char myChar, int numChars) { while (numChars > 0) { cout << myChar; numChars--; } cout << endl; return; }