Advertisement
Guest User

Untitled

a guest
Mar 25th, 2017
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.71 KB | None | 0 0
  1. using System;
  2.  
  3. namespace MyProject
  4. {
  5. class Program
  6. {
  7. struct czlowiek
  8. {
  9. public string imie;
  10. public string nazwisko;
  11. public int waga;
  12. public int wiek;
  13.  
  14. public void wypiszWage()
  15. {
  16. Console.WriteLine($"Twoja waga wynosi {this.waga}");
  17.  
  18. }
  19.  
  20.  
  21. }
  22.  
  23. static void odchudz( ref czlowiek cz, int ile = 1)
  24. {
  25. cz.waga -= ile;
  26. }
  27. static void Main()
  28. {
  29. czlowiek typ = new czlowiek();
  30. typ.waga = 80;
  31. typ.imie = "Jan";
  32. typ.nazwisko = "Kowalski";
  33. typ.wiek = 25;
  34. typ.wypiszWage();
  35. odchudz( ref typ, typ);
  36. typ.wypiszWage();
  37. Console.ReadKey();
  38. }
  39.  
  40. }
  41.  
  42.  
  43. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement