123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
#include <iostream> #include <fstream> #include <sstream> #include <cmath> #include <ctime> #include <iomanip> #include <string> #include <cstdlib> #include <algorithm> using namespace std; /// /// Main Function /// int main(){ fstream input_file; ///< Input file stream string input_filename; ///< Input file name double perimeter = 0; ///< Area of the polygon double area = 0; ///< Perimeter of the polygon double temp = 0; double points = 0; //prompt for input filename cout << "Enter the input filename: "; getline( cin, input_filename ); //open input file input_file.open( input_filename.c_str(), ios::in ); //Validate the filestream if( input_file.fail() ){ cerr << "Input file is invalid.\n"; return 1; } //Your code starts here double pointer [4][2]; //array for pointer for( int i = 0; i < 4; i++){ for( int j = 0; j < 2; j++){ points [i][j] = 0; } } input_file >> points [i][0] >> points [i][1];
12
input_file >> points [i][0] >> points [i][1];
points