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;
- namespace zadanie1
- {
- public class samochod
- {
- string marka, model;
- int ilosc_drzwi;
- double sredn_spalenie;
- int pojemnosc_silnika;
- int liczba_samochodow = 0;
- public samochod(string marka_ = "", string model_ = "", int ilosc_drzwi_ = 0)
- {
- this.marka = marka_;
- this.model = model_;
- this.ilosc_drzwi = ilosc_drzwi_;
- liczba_samochodow++;
- }
- int get_number() { return liczba_samochodow; }
- public string get_marka() { return marka; } public string get_model() { return model; }
- }
- }
- ///////////////////////
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace zadanie1
- {
- class Program
- {
- static void Main(string[] args)
- {
- samochod S = new samochod("Mazda", "RX-8", 2);
- samochod S1 = new samochod("BMW", "M4", 2);
- samochod S2 = new samochod("Audi", "RS-6 Evhotech", 4);
- Console.WriteLine(S.get_number());
- Console.ReadLine();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement