I have to match up airlines for flights in c++, but for certain matchups, the value would be equal to x. I need help to do it.
Here's the code I have so far:
#include <iostream>
using namespace std;
int main()
{
int nROWS = 4;
int nCOLUMNS = 4;
int anArray[4][4] = {{0,1,2,3}, {10,11,12,13}, {20,21,22,23}, {30,31,32,33}};
string headings[4] = {"LA", "CLT", "SVO", "FR"};
cout << headings[4]<<endl;
for (int ROWS = 0; ROWS < nROWS; ROWS++)
{
cout << headings[ROWS]<<endl;
for (int COLUMNS = 0; COLUMNS < nCOLUMNS; COLUMNS++){
cout << anArray[ROWS][COLUMNS] << endl;
if (anArray[1][1] = 0)
cout << "X";
else
cout << anArray[ROWS];
if (anArray[2][1] = 10)
cout << "X";
else
cout << anArray[ROWS];
if (anArray[2][2] = 11)
cout << "X";
else
cout << anArray[ROWS];
if (anArray[3][3] = 22)
cout << "X";
else
cout << anArray[ROWS];
if (anArray[4][4] = 33)
cout <<"X";
else
cout << anArray[ROWS];
}
}
system("pause");
return 0;
}