Advertisement
kaunas163

Untitled

Apr 2nd, 2015
211
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.46 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. class Varza
  5. {
  6. private:
  7.     int R1, R2, R3, R4;
  8. public:
  9.     Varza() : R1(0), R2(0), R3(0), R4(0) { }
  10.     void Ivedimas();
  11.     int operator + () { return R1 + R2 + R3 + R4; }
  12. };
  13.  
  14. void Varza::Ivedimas()
  15. {
  16.     cout << "Ivesktie R1: "; cin >> R1;
  17.     cout << "Ivesktie R2: "; cin >> R2;
  18.     cout << "Ivesktie R3: "; cin >> R3;
  19.     cout << "Ivesktie R4: "; cin >> R4;
  20. }
  21.  
  22. int main()
  23. {
  24.     Varza varzos;
  25.     varzos.Ivedimas();
  26.     return 0;
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement