using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ConsoleApplication3
{
class Program
{
static void Main(string[] args)
{
var s1 = new Samochod("marka1", "12356", 8, 123, 5);
var s2 = new Samochod(s1);
s2.Info();
var c1 = new Ciezarowka("marka1", "12356", 8, 123, 5, 3522, 12);
var c2 = new Ciezarowka(c1);
c2.Info();
Console.ReadKey();
}
}
class Samochod
{
protected static int ilosc;
protected string marka, numer;
protected int pojemnosc, przebieg;
protected int spalanie {get; set;}
static Samochod(){
ilosc = 0;
}
public Samochod()
{
ilosc++;
}
public Samochod(string marka, string numer, int pojemnosc, int przebieg, int spalanie) : this()
{
this.marka = marka;
this.numer = numer;
this.pojemnosc = pojemnosc;
this.przebieg = przebieg;
this.spalanie = spalanie;
}
public Samochod (Samochod s) : this()
{
marka = s.marka;
numer = s.numer;
pojemnosc = s.pojemnosc;
przebieg = s.przebieg;
spalanie = s.spalanie;
}
public void aktualizuj_przebieg(int przejechano){
przebieg += przejechano;
}
public int ile_benzyny(int odleglosc){
return odleglosc*spalanie;
}
public void Info(){
Console.WriteLine("{0}, nr. {1}, pojemnosc {2}, przebieg {3}, spalanie {4}", marka, numer, pojemnosc, przebieg, spalanie);
}
}
class Ciezarowka : Samochod{
int ladownosc,
dopMasa;
public Ciezarowka(string marka, string numer, int pojemnosc, int przebieg, int spalanie, int ladownosc, int dopMasa) : base(marka, numer, pojemnosc, przebieg, spalanie)
{
this.ladownosc = ladownosc;
this.dopMasa = dopMasa;
}
public Ciezarowka() : base() {
}
public Ciezarowka(Ciezarowka c){
marka = c.marka;
numer = c.numer;
pojemnosc = c.pojemnosc;
przebieg = c.przebieg;
spalanie = c.spalanie;
ladownosc = c.ladownosc;
dopMasa = c.dopMasa;
}
public void Info(){
base.Info();
Console.WriteLine("ladownosc {0}, dop masa przyczepy {1}", ladownosc, dopMasa);
}
}
}
{"html5":"htmlmixed","css":"css","javascript":"javascript","php":"php","python":"python","ruby":"ruby","lua":"text\/x-lua","bash":"text\/x-sh","go":"go","c":"text\/x-csrc","cpp":"text\/x-c++src","diff":"diff","latex":"stex","sql":"sql","xml":"xml","apl":"apl","asterisk":"asterisk","c_loadrunner":"text\/x-csrc","c_mac":"text\/x-csrc","coffeescript":"text\/x-coffeescript","csharp":"text\/x-csharp","d":"d","ecmascript":"javascript","erlang":"erlang","groovy":"text\/x-groovy","haskell":"text\/x-haskell","haxe":"text\/x-haxe","html4strict":"htmlmixed","java":"text\/x-java","java5":"text\/x-java","jquery":"javascript","mirc":"mirc","mysql":"sql","ocaml":"text\/x-ocaml","pascal":"text\/x-pascal","perl":"perl","perl6":"perl","plsql":"sql","properties":"text\/x-properties","q":"text\/x-q","scala":"scala","scheme":"text\/x-scheme","tcl":"text\/x-tcl","vb":"text\/x-vb","verilog":"text\/x-verilog","yaml":"text\/x-yaml","z80":"text\/x-z80"}