Advertisement
Guest User

Untitled

a guest
May 24th, 2018
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.17 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace ConsoleApplication51
  8. {
  9. class Address
  10. {
  11. public Address(string s1,string s2,System.DateTime dt)
  12. {
  13. city = s1;
  14. addressLine = s2;
  15. modifiedDate = dt;
  16. number = Convert.ToInt32(s2.Split()[0]);
  17. text = addressLine.Substring(s2.Split()[0].Length + 1, addressLine.Length -1- s2.Split()[0].Length);
  18. }
  19. string addressLine, city, text;
  20. int number;
  21. DateTime modifiedDate;
  22. public override string ToString()
  23. {
  24. return city + " " + addressLine + " " + modifiedDate.ToShortDateString() + " " + number + " " + text;
  25. }
  26. }
  27. class AddressList
  28. {
  29. Address[] M;
  30. int Count
  31. {
  32. get { }
  33. set { }
  34. }
  35. }
  36. class Program
  37. {
  38. static void Main(string[] args)
  39. {
  40. Address ad = new Address("Moscow", "223 Druzhinnikov street", new System.DateTime(2018,05,24));
  41. Console.WriteLine(ad);
  42. }
  43. }
  44. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement