The general call to the executable is as follow in Linux:
./main input=input31.txt output=output31.txt
The input file and the outputted result should fulfill the following requirements.
1) Like above command shows, two arguments will be given when running your
program.
2) The first argument means the file that contains numbers is input31.txt. The second
argument means your output file name is output31.txt.
3) All the input and output file names are changing depend on different test cases.
4) When reading the input file, you should go through each character and form the
actual number.
5) A number may have three different forms: 1. Number, ranging from 0 to 9. 2.Numbers in words, ranging from zero to nine, without spaces in between, are in lower case, ending with a “word”. 3. Numbers with addition/subtraction, ranging from 0 to 9, result from 0 to 9, numbers and operator separated with space(s). All the numbers are meaningful without error.
6) Each line contains one form of number, one form of number contained in one line.
7) The output file contains “match” or “not match” (case sensitive). If all the numbers
equal to each other, you should output “match”, otherwise output “not match”.
What I have tried:
lang="c++">
#include<iostream>
#include<fstream>
#include<cstring>
#include "ArgumentManager.h"
using namespace std;
int main(int argc, char **argv)
{
ifstream fin;
ofstream fout;
ArgumentManager am(argc, argv, ' ');
string inputFileName = am.get("inout");
string outputFileName = am.get("output");
fin.open(inputFileName.c_str());
fout.open(outputFileName.c_str());
char ch;
cin ch;
}