1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
|
int main()
{
int A = 0, B = 0, C = 0, validCount = 0;
ifstream input;
input.open("date.dat");
Date allPossible[6], allValid[6];
input >> A;
input >> B;
input >> C;
allPossible[0].set(A, B, C);
allPossible[1].set(A, C, B);
allPossible[2].set(B, A, C);
allPossible[3].set(B, C, A);
allPossible[4].set(C, B, A);
allPossible[5].set(C, A, B);
for(int index = 0; index <= 5; index++)
{
if(allPossible[index].checkValidity())
{
allValid[validCount] = allPossible[index];
validCount++;
}
}
for(int index = 0; index <= validCount; index++)
{
cout << allValid[index].getDay() << "/" << allValid[index].getMonth() << "/" << allValid[index].getYear() << endl;
}
system("Pause");
}
|