#include #include using namespace std; string fileName; // This assignment is worth 5 points int main() { cout << "Enter file name: "; cin >> fileName; cin.ignore(); ifstream inputFile; inputFile.open(fileName); if(inputFile.fail()) { cout << "Unable to open file. Exiting..." << endl; inputFile.close(); return 0; } double temp; int rows = 0, cols = 0; cout << "Now reading " << fileName << "..." << endl; while(inputFile >> temp) { cols++; if(inputFile.get() == '\n') rows++; } cols /= rows; cout << "Matrix size: " << rows << 'x' << cols << endl; return 0; }