#include <fstream.h>
#include <iostream.h>
#include <stdlib.h>
#include <stdio.h>

using namespace std;

int main()
{       
       int ref[3] = {2,10,2010};
       int arr[5][3];
       int i = 0;
       int j = 0;
       int inc[5] = {0};
       bool enough;
      
       
       ifstream infile;    //creates file object
       infile.open("data1.txt");   // opens file for input.
        
       ofstream outfile;
       outfile.open("out1.txt");      
       
       
       for (i=0;i<5;i++)
       {
           for (j=0;j<3;j++)
           {
               infile >> arr[i][j];
               cout << arr[i][j]<< endl;
           }          
       }
       
        
        for (i=0;i<5;i++)
        {
            enough = arr[i][2] < 1997 || arr[i][2] == 1997 && arr[i][1] < 10 || arr[i][2] ==1997 && arr[i][1]==10 && arr[i][0] <= 2;
            
            if (enough) outfile << "old enough" << endl;
            else outfile << "too young" << endl;
        }
       

       
       system ("pause");
       return (0);
}

