// ConsoleApplication1.cpp : Defines the entry point for the console application. // #include "stdafx.h" #include 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; }