// ConsoleApplication1.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <iostream>
using namespace std;
class Kalkulator
{
double result = 0;
public:
const static double add(double a, double b)
{
return a + b;
}
const static double Substract(double a, double b)
{
return a - b;
}
const static double Multiply(double a, double b)
{
return a * b;
}
const static double Divide(double a, double b)
{
return a / b;
}
void add(double a)
{
result = add(result, a);
}
void Substract(double a)
{
result = Substract(result, a);
}
void Multiply(double a)
{
result = Multiply(result, a);
}
void Divide(double a)
{
result = Divide(result, a);
}
double GetResult()
{
return result;
}
void reset()
{
result = 0;
}
};
int main()
{
Kalkulator calc;
calc.add(1);
Kalkulator calc2 = calc;
calc.Multiply(5);
cout << calc.GetResult() << " " << calc2.GetResult() << endl;
system("pause");
return 0;
}
{"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"}