Advertisement
Guest User

Untitled

a guest
Mar 19th, 2018
115
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.32 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 ConsoleApp39
  8. {
  9. class Robol
  10. {
  11. string imie, nazwisko;
  12.  
  13. public Robol(string nazwisko, string imie)
  14. {
  15. this.imie = imie;
  16. this.nazwisko = nazwisko;
  17. }
  18. public void wyswietlDane()
  19. {
  20. Console.WriteLine($"Imie:{imie}\nNazwisko:{nazwisko}");
  21. }
  22. }
  23. class Program
  24. {
  25. static void Main(string[] args)
  26. {
  27. DateTime data = new DateTime(2000,12,12);
  28. DateTime data_now = DateTime.Now;
  29. dynamic roznica = (data_now - data);
  30. List<Robol> Lista_roboli = new List<Robol>();
  31. for (int x = 0; x < 2; x++)
  32. {
  33. Console.WriteLine("Given name:");
  34. string imie = Console.ReadLine();
  35. Console.WriteLine("Given surname:");
  36. string nazwisko = Console.ReadLine();
  37. Lista_roboli.Add(new Robol(imie, nazwisko));
  38.  
  39. }
  40.  
  41. foreach(dynamic x in Lista_roboli)
  42. {
  43. x.wyswietlDane();
  44. }
  45. Console.WriteLine(roznica.Days);
  46. Console.ReadKey();
  47.  
  48. }
  49. }
  50. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement