Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using System.IO;
- namespace Daniel_Kazarnowicz_1
- {
- public class klasa
- {
- public int wartosc;
- public void zmien(int nowa)
- {
- wartosc = nowa;
- }
- public void wyswietl()
- {
- Console.WriteLine("wartosc: {0} ", wartosc);
- }
- }
- class Program
- {
- static void Podwoj(struktura s)
- {
- s.wartosc = s.wartosc * 2;
- }
- static void Podwoj1(klasa k)
- {
- k.wartosc = k.wartosc * 2;
- }
- static void Main(string[] args)
- {
- struktura s = new struktura();
- s.wyswietl();
- s.zmien(200);
- Podwoj(s);
- s.wyswietl();
- klasa k = new klasa();
- k.wyswietl();
- k.zmien(201);
- Podwoj1(k);
- k.wyswietl();
- Console.ReadKey();
- }
- }
- struct struktura
- {
- public int wartosc;
- public void zmien(int nowa)
- {
- wartosc = nowa;
- }
- public void wyswietl()
- {
- Console.WriteLine("wartosc: {0} ", wartosc);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement