using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.IO; namespace DwiteC5 { class Program { static void Main(string[] args) { string year = null; string month = null; string day = null; int year1 = 0; int month1 = 0; int day1 = 0; string whole = null; StreamReader SR = new StreamReader("DATA1.txt"); StreamWriter SW = new StreamWriter("OUT1.txt"); for (int i = 0; i < 5; i++) { whole = SR.ReadLine(); day = whole.Substring(0, 2); month = whole.Substring(3,2); year = whole.Substring(6, 4); year1 = Convert.ToInt32(year); month1 = Convert.ToInt32(month); day1 = Convert.ToInt32(day); if (year1 > 1997 || year1 == 1997 && month1 > 10 || year1 == 1997 && month1 == 10 && day1 > 27) { SW.WriteLine("too young"); } else { SW.WriteLine("old enough"); } } SR.Close(); SW.Close(); } } }