Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace MyProject
- {
- class Program
- {
- struct czlowiek
- {
- public string imie;
- public string nazwisko;
- public int waga;
- public int wiek;
- public void wypiszWage()
- {
- Console.WriteLine($"Twoja waga wynosi {this.waga}");
- }
- }
- static void odchudz( ref czlowiek cz, int ile = 1)
- {
- cz.waga -= ile;
- }
- static void Main()
- {
- czlowiek typ = new czlowiek();
- typ.waga = 80;
- typ.imie = "Jan";
- typ.nazwisko = "Kowalski";
- typ.wiek = 25;
- typ.wypiszWage();
- odchudz( ref typ, typ);
- typ.wypiszWage();
- Console.ReadKey();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement