Advertisement
ivanov_ivan

AgeHelp

Jan 20th, 2016
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.06 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Globalization;
  4. using System.Linq;
  5. using System.Text;
  6. using System.Threading.Tasks;
  7.  
  8. namespace Test
  9. {
  10.     class Program
  11.     {
  12.         static void Main(string[] args)
  13.         {
  14.             //Console.WriteLine("Въведете годините си: "); // Това го премахваш
  15.  
  16.             string age = Console.ReadLine();
  17.  
  18.             DateTime myBirthDay = DateTime.Parse(age);
  19.  
  20.             //int ageNow = int.Parse(age); // Това ще ти връща формат ексепшън
  21.  
  22.             DateTime today = DateTime.Now;
  23.             // Разгледай възможностите на myBirthDay.Day ... myBirthDay.Month ... myBirthDay.Year .... респективно today.{properties}
  24.  
  25.             //DateTime future = today.AddYears(10);
  26.             //DateTime futureYear = future.AddYears(ageNow);
  27.             //int futureAge = futureYear.Year - today.Year;
  28.             //Console.WriteLine("След 10 години, ще сте на: " + "\n" + futureAge);
  29.         }
  30.     }
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement